mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-09-04 14:45:23 +00:00
Use hashtable to create PSCustomObject for GPO details
- Simplify code by using a hashtable to create PSCustomObject for GPO details in "Get-GPOZaurrAD.ps1" script.
This commit is contained in:
+14
-14
@@ -91,20 +91,20 @@
|
|||||||
if (($GUID).Length -ne 36) {
|
if (($GUID).Length -ne 36) {
|
||||||
Write-Warning "Get-GPOZaurrAD - GPO GUID ($($($GUID.Replace("`n",' ')))) is incorrect. Skipping $($_.DisplayName) / Domain: $($DomainCN)"
|
Write-Warning "Get-GPOZaurrAD - GPO GUID ($($($GUID.Replace("`n",' ')))) is incorrect. Skipping $($_.DisplayName) / Domain: $($DomainCN)"
|
||||||
} else {
|
} else {
|
||||||
$Output = [ordered]@{ }
|
[PSCustomObject]@{
|
||||||
$Output['DisplayName'] = $_.DisplayName
|
'DisplayName' = $_.DisplayName
|
||||||
$Output['DomainName'] = $DomainCN
|
'DomainName' = $DomainCN
|
||||||
$Output['Description'] = $_.Description
|
'Description' = $_.Description
|
||||||
$Output['GUID'] = $GUID
|
'GUID' = $GUID
|
||||||
$Output['Path'] = $_.gPCFileSysPath
|
'Path' = $_.gPCFileSysPath
|
||||||
#$Output['FunctionalityVersion'] = $_.gPCFunctionalityVersion
|
#$Output['FunctionalityVersion'] = $_.gPCFunctionalityVersion
|
||||||
$Output['Created'] = $_.Created
|
'Created' = $_.Created
|
||||||
$Output['Modified'] = $_.Modified
|
'Modified' = $_.Modified
|
||||||
$Output['Owner'] = $_.ntSecurityDescriptor.Owner
|
'Owner' = $_.ntSecurityDescriptor.Owner
|
||||||
$Output['GPOCanonicalName'] = $_.CanonicalName
|
'GPOCanonicalName' = $_.CanonicalName
|
||||||
$Output['GPODomainDistinguishedName'] = ConvertFrom-DistinguishedName -DistinguishedName $_.DistinguishedName -ToDC
|
'GPODomainDistinguishedName' = ConvertFrom-DistinguishedName -DistinguishedName $_.DistinguishedName -ToDC
|
||||||
$Output['GPODistinguishedName'] = $_.DistinguishedName
|
'GPODistinguishedName' = $_.DistinguishedName
|
||||||
[PSCustomObject] $Output
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user