Files
GPOZaurr/Private/Get-XMLRegistrySettings.ps1
T
Przemyslaw Klys 570b1cbc83 Added Find-GPO WIP
2020-06-27 12:45:23 +02:00

35 lines
1.7 KiB
PowerShell

function Get-XMLRegistrySettings {
[cmdletBinding()]
param(
[PSCustomObject] $GPO,
[System.Xml.XmlElement[]] $GPOOutput,
[string] $Splitter = [System.Environment]::NewLine,
[switch] $FullObjects
)
$LinksInformation = Get-LinksFromXML -GPOOutput $GPOOutput -Splitter $Splitter -FullObjects:$FullObjects
foreach ($Type in @('User', 'Computer')) {
if ($GPOOutput.$Type.ExtensionData.Extension) {
foreach ($ExtensionType in $GPOOutput.$Type.ExtensionData.Extension) {
foreach ($Key in $ExtensionType.RegistrySettings.Registry) {
[PSCustomObject] @{
DisplayName = $GPO.DisplayName
DomainName = $GPO.DomainName
GUID = $GPO.Guid
Linked = $LinksInformation.Linked
LinksCount = $LinksInformation.LinksCount
Links = $LinksInformation.Links
GpoType = $Type
Changed = [DateTime] $Key.changed
GPOSettingOrder = $Key.GPOSettingOrder
Hive = $Key.Properties.hive #: HKEY_LOCAL_MACHINE
Key = $Key.Properties.key #: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Name = $Key.Properties.name #: AutoAdminLogon
Type = $Key.Properties.type #: REG_SZ
Value = $Key.Properties.value #
Filters = $Key.Filters
}
}
}
}
}
}