mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 11:49:17 +00:00
Add ability to limit GPO analysis by GPOName/GPOGUID
This commit is contained in:
@@ -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 = {
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user