mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-27 12:18:59 +00:00
49 lines
2.2 KiB
PowerShell
49 lines
2.2 KiB
PowerShell
function Get-XMLScripts {
|
|
[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.Script) {
|
|
if ($FullObjects) {
|
|
[PSCustomObject] @{
|
|
DisplayName = $GPO.DisplayName
|
|
DomainName = $GPO.DomainName
|
|
GUID = $GPO.Guid
|
|
Linked = $LinksInformation.Linked
|
|
LinksCount = $LinksInformation.LinksCount
|
|
Links = $LinksInformation.Links
|
|
GpoType = $Type
|
|
Command = $Key.Command
|
|
Parameters = $Key.Parameters
|
|
Type = $Key.Type
|
|
Order = $Key.Order
|
|
RunOrder = $Key.RunOrder
|
|
}
|
|
} else {
|
|
[PSCustomObject] @{
|
|
DisplayName = $GPO.DisplayName
|
|
DomainName = $GPO.DomainName
|
|
GUID = $GPO.Guid
|
|
Linked = $LinksInformation.Linked
|
|
LinksCount = $LinksInformation.LinksCount
|
|
Links = $LinksInformation.Links
|
|
GpoType = $Type
|
|
Command = $Key.Command
|
|
Parameters = $Key.Parameters
|
|
type = $Key.Type
|
|
Order = $Key.Order
|
|
RunOrder = $Key.RunOrder
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |