mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-05 16:39:28 +00:00
38 lines
1.8 KiB
PowerShell
38 lines
1.8 KiB
PowerShell
function Get-XMLStandard {
|
|
[cmdletBinding()]
|
|
param(
|
|
[PSCustomObject] $GPO,
|
|
[System.Xml.XmlElement[]] $GPOOutput,
|
|
[string] $Splitter,
|
|
[switch] $FullObjects
|
|
)
|
|
$LinksInformation = Get-LinksFromXML -GPOOutput $GPOOutput -Splitter $Splitter -FullObjects:$FullObjects
|
|
foreach ($GpoType in @('User', 'Computer')) {
|
|
if ($GPOOutput.$GpoType.ExtensionData.Extension) {
|
|
foreach ($ExtensionType in $GPOOutput.$GpoType.ExtensionData.Extension) {
|
|
$GPOSettingTypeSplit = ($ExtensionType.type -split ':')
|
|
$KeysToLoop = $ExtensionType | Get-Member -MemberType Properties | Where-Object { $_.Name -notin 'type', $GPOSettingTypeSplit[0] }
|
|
foreach ($GpoSettings in $KeysToLoop.Name) {
|
|
foreach ($Key in $ExtensionType.$GpoSettings) {
|
|
$Template = [ordered] @{
|
|
DisplayName = $GPO.DisplayName
|
|
DomainName = $GPO.DomainName
|
|
GUID = $GPO.Guid
|
|
GpoType = $GpoType
|
|
GpoCategory = $GPOSettingTypeSplit[1]
|
|
GpoSettings = $GpoSettings
|
|
}
|
|
$Properties = ($Key | Get-Member -MemberType Properties).Name
|
|
foreach ($Property in $Properties) {
|
|
$Template["$Property"] = $Key.$Property
|
|
}
|
|
$Template['Linked'] = $LinksInformation.Linked
|
|
$Template['LinksCount'] = $LinksInformation.LinksCount
|
|
$Template['Links'] = $LinksInformation.Links
|
|
[PSCustomObject] $Template
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |