diff --git a/Private/Invoke.GPOZaurrAnalysis.ps1 b/Private/Invoke.GPOZaurrAnalysis.ps1 index 9b71e7a..cfbdb08 100644 --- a/Private/Invoke.GPOZaurrAnalysis.ps1 +++ b/Private/Invoke.GPOZaurrAnalysis.ps1 @@ -4,7 +4,7 @@ ActionRequired = $null Data = $null Execute = { - Invoke-GPOZaurrContent -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains + Invoke-GPOZaurrContent -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -GPOName $GPOName -GPOGUID $GPOGUID } Processing = { diff --git a/Public/Invoke-GPOZaurr.ps1 b/Public/Invoke-GPOZaurr.ps1 index aa6f123..4331889 100644 --- a/Public/Invoke-GPOZaurr.ps1 +++ b/Public/Invoke-GPOZaurr.ps1 @@ -75,7 +75,10 @@ [string[]] $ExcludeDomains, [alias('Domain', 'Domains')][string[]] $IncludeDomains, [switch] $Online, - [switch] $SplitReports + [switch] $SplitReports, + + [Alias('Name')][string[]] $GPOName, + [Alias('GUID')][string[]] $GPOGUID ) Reset-GPOZaurrStatus # This makes sure types are at it's proper status diff --git a/Public/Invoke-GPOZaurrContent.ps1 b/Public/Invoke-GPOZaurrContent.ps1 index 81d7d04..fc3a25a 100644 --- a/Public/Invoke-GPOZaurrContent.ps1 +++ b/Public/Invoke-GPOZaurrContent.ps1 @@ -53,7 +53,13 @@ [Parameter(ParameterSetName = 'Local')] [switch] $SkipCleanup, - [switch] $Extended + [switch] $Extended, + + [Parameter(ParameterSetName = 'Default')] + [Alias('Name')][string[]] $GPOName, + + [Parameter(ParameterSetName = 'Default')] + [string[]] $GPOGUID ) if ($Type.Count -eq 0) { $Type = $Script:GPODitionary.Keys @@ -82,6 +88,16 @@ Write-Warning "Invoke-GPOZaurrContent - $GPOPath doesn't exists." return } + } elseif ($GPOName) { + Write-Verbose "Invoke-GPOZaurrContent - Query AD for GPOs" + [Array] $GPOs = @( + foreach ($Name in $GPOName) { + Get-GPOZaurrAD -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation -GPOName $Name + } + foreach ($GUID in $GPOGUID) { + Get-GPOZaurrAD -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation -GPOGUID $GUID + } + ) } else { Write-Verbose "Invoke-GPOZaurrContent - Query AD for GPOs" [Array] $GPOs = Get-GPOZaurrAD -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation