This commit is contained in:
Przemyslaw Klys
2020-10-13 00:14:14 +02:00
parent b4f014855b
commit 1061484247
3 changed files with 73 additions and 26 deletions
+13 -2
View File
@@ -50,7 +50,9 @@
[Parameter(ParameterSetName = 'Default')]
[Parameter(ParameterSetName = 'Local')]
[switch] $SkipCleanup
[switch] $SkipCleanup,
[switch] $Extended
)
if ($Type.Count -eq 0) {
$Type = $Script:GPODitionary.Keys
@@ -219,9 +221,18 @@
#$Output['PoliciesTotal'] = $Output.Reports.Policies.PolicyCategory | Group-Object | Select-Object Name, Count | Sort-Object -Property Count -Descending
if (-not $SkipCleanup) {
Write-Verbose "Invoke-GPOZaurr - Cleaning up output"
Remove-EmptyValue -Hashtable $Output -Recursive
}
return $Output
if ($Extended) {
$Output
} else {
if ($Output.Reports) {
$Output.Reports
} else {
Write-Warning "Invoke-GPOZaurr - There was no data output for requested types."
}
}
}
[scriptblock] $SourcesAutoCompleter = {
+4
View File
@@ -17,8 +17,12 @@
}
}
$null = New-Item -ItemType Directory -Path $GPOPath -Force
Write-Verbose "Save-GPOZaurrFiles - Gathering GPO data"
$Count = 0
$GPOs = Get-GPOZaurrAD -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
foreach ($GPO in $GPOS) {
$Count++
Write-Verbose "Save-GPOZaurrFiles - Processing GPO ($Count/$($GPOS.Count)) $($GPO.DomainName) | $($GPO.DisplayName)"
$XMLContent = Get-GPOReport -ID $GPO.Guid -ReportType XML -Domain $GPO.DomainName
$GPODOmainFolder = [io.path]::Combine($GPOPath, $GPO.DomainName)
if (-not (Test-Path -Path $GPODOmainFolder)) {