mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 11:49:17 +00:00
Fix when GPO is not linked
This commit is contained in:
@@ -44,9 +44,16 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$OrganizationalUnitsObjects = Get-ADOrganizationalUnitObject -OrganizationalUnit $LinksDN -Summary -IncludeAffectedOnly
|
||||
|
||||
if ($LinksDN.Count -gt 0) {
|
||||
$OrganizationalUnitsObjects = Get-ADOrganizationalUnitObject -OrganizationalUnit $LinksDN -Summary -IncludeAffectedOnly
|
||||
} else {
|
||||
# GPO is not linked
|
||||
$OrganizationalUnitsObjects = [PSCUstomObject] @{
|
||||
ObjectsTotalCount = 0
|
||||
ObjectsBlockedInheritanceCount = 0
|
||||
ObjectsClasses = @()
|
||||
}
|
||||
}
|
||||
[PSCustomObject] @{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
|
||||
Reference in New Issue
Block a user