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 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($LinksDN.Count -gt 0) {
|
||||||
$OrganizationalUnitsObjects = Get-ADOrganizationalUnitObject -OrganizationalUnit $LinksDN -Summary -IncludeAffectedOnly
|
$OrganizationalUnitsObjects = Get-ADOrganizationalUnitObject -OrganizationalUnit $LinksDN -Summary -IncludeAffectedOnly
|
||||||
|
} else {
|
||||||
|
# GPO is not linked
|
||||||
|
$OrganizationalUnitsObjects = [PSCUstomObject] @{
|
||||||
|
ObjectsTotalCount = 0
|
||||||
|
ObjectsBlockedInheritanceCount = 0
|
||||||
|
ObjectsClasses = @()
|
||||||
|
}
|
||||||
|
}
|
||||||
[PSCustomObject] @{
|
[PSCustomObject] @{
|
||||||
DisplayName = $GPO.DisplayName
|
DisplayName = $GPO.DisplayName
|
||||||
DomainName = $GPO.DomainName
|
DomainName = $GPO.DomainName
|
||||||
|
|||||||
Reference in New Issue
Block a user