ps/Modules/Alkami.PowerShell.Common/Public/Get-SecurityPolicy.ps1

18 lines
403 B
PowerShell
Raw Permalink Normal View History

2023-05-30 22:51:22 -07:00
function Get-SecurityPolicy {
<#
.SYNOPSIS
Gets the security policy and returns the full content.
#>
param(
)
$logLead = (Get-LogLeadName);
$exportFile = [System.IO.Path]::GetTempFileName()
Write-Verbose ("$logLead : Exporting local security policy to {0}" -f $exportFile)
secedit.exe /export /cfg $($exportFile) | Out-Null
return ( Get-Content -Path $exportFile )
}