mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-13 04:06:56 +00:00
Updates to Find-GPO
This commit is contained in:
@@ -3,12 +3,19 @@
|
||||
# Use Save-GPOZaurrFiles -GPOPath $ENV:USERPROFILE\Desktop\GPOExport
|
||||
|
||||
$Output = Find-GPO -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest'
|
||||
$Output | Format-Table *
|
||||
$Output | Format-Table
|
||||
|
||||
New-HTML {
|
||||
foreach ($Key in $Output.Keys) {
|
||||
New-HTMLTab -Name $Key {
|
||||
New-HTMLTable -DataTable $Output[$Key] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
foreach ($GPOCategory in $Output.Keys) {
|
||||
New-HTMLTab -Name $GPOCategory {
|
||||
foreach ($GpoSettings in $Output.$GPOCategory.Keys) {
|
||||
New-HTMLTab -Name $GpoSettings {
|
||||
New-HTMLTable -DataTable $Output[$GPOCategory][$GpoSettings] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} -Online -ShowHTML -FilePath $Env:UserProfile\Desktop\OutputFromFindGPO.html
|
||||
} -Online -ShowHTML -FilePath $Env:UserProfile\Desktop\OutputFromFindGPO.html
|
||||
|
||||
|
||||
#Select-Properties -AllProperties -Objects $Output.SecuritySettings
|
||||
@@ -3,17 +3,17 @@
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
[System.Xml.XmlElement[]] $GPOOutput,
|
||||
[string] $Splitter = [System.Environment]::NewLine,
|
||||
[string] $Splitter,
|
||||
[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 ($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 ($Keys in $KeysToLoop.Name) {
|
||||
foreach ($Key in $ExtensionType.$Keys) {
|
||||
foreach ($GpoSettings in $KeysToLoop.Name) {
|
||||
foreach ($Key in $ExtensionType.$GpoSettings) {
|
||||
$Template = [ordered] @{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
@@ -21,8 +21,9 @@
|
||||
Linked = $LinksInformation.Linked
|
||||
LinksCount = $LinksInformation.LinksCount
|
||||
Links = $LinksInformation.Links
|
||||
GpoType = $Type
|
||||
GpoSubType = $GPOSettingTypeSplit[1]
|
||||
GpoType = $GpoType
|
||||
GpoCategory = $GPOSettingTypeSplit[1]
|
||||
GpoSettings = $GpoSettings
|
||||
}
|
||||
$Properties = ($Key | Get-Member -MemberType Properties).Name
|
||||
foreach ($Property in $Properties) {
|
||||
|
||||
+21
-4
@@ -77,16 +77,32 @@
|
||||
UserPolicies = $GPOOutput.GPO.User.ExtensionData.Name -join ", "
|
||||
}
|
||||
#>
|
||||
$GPOStoredTypes = Get-XMLGPOTypes -GPOOutput $GPOOutput.GPO
|
||||
|
||||
$GPODitionary = @{
|
||||
'SecuritySettings' = @{
|
||||
Name = 'Security Settings'
|
||||
Translate = [ordered] @{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#$GPOStoredTypes = Get-XMLGPOTypes -GPOOutput $GPOOutput.GPO
|
||||
|
||||
[Array] $Data = Get-XMLStandard -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
if (-not $Output["$($D.GpoSubType)"]) {
|
||||
$Output["$($D.GpoSubType)"] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
if (-not $Output["$($D.GpoCategory)"]) {
|
||||
$Output["$($D.GpoCategory)"] = [ordered] @{}
|
||||
}
|
||||
$Output["$($D.GpoSubType)"].Add($D)
|
||||
if (-not $Output["$($D.GpoCategory)"]["$($D.GpoSettings)"]) {
|
||||
$Output["$($D.GpoCategory)"]["$($D.GpoSettings)"] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
}
|
||||
$Output["$($D.GpoCategory)"]["$($D.GpoSettings)"].Add($D)
|
||||
}
|
||||
|
||||
<#
|
||||
continue
|
||||
|
||||
if ($Type -contains 'RegistrySettings') {
|
||||
@@ -143,6 +159,7 @@
|
||||
$Output['SystemServices'].Add($D)
|
||||
}
|
||||
}
|
||||
#>
|
||||
}
|
||||
$Output
|
||||
}
|
||||
Reference in New Issue
Block a user