Private/Get-GPOAclSimple.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
function Get-GPOAclSimple { Param( [Parameter(Mandatory = $true)] [Alias("GroupPolicy")] $groupPolicyObject ) [xml]$xmlGPOReport = $groupPolicyObject.generatereport('xml') #Output [PsCustomObject] @{ 'Name' = $xmlGPOReport.GPO.Name 'ACL' = $xmlGPOReport.GPO.SecurityDescriptor.Permissions.TrusteePermissions | ForEach-Object -Process { [PSCustomObject] @{ 'User' = $_.trustee.name.'#Text' 'Permission Type' = $_.type.PermissionType 'Inherited' = $_.Inherited 'Permissions' = $_.Standard.GPOGroupedAccessEnum } } } } |