This commit is contained in:
Przemyslaw Klys
2020-10-01 22:52:28 +02:00
parent dfff00d4cf
commit d0bd7b1cdc
3 changed files with 10 additions and 12 deletions
+2 -3
View File
@@ -5,7 +5,6 @@
# If you want to see also owners
# 'GpoOwner'
# If you want to include Root Level Permissions
# 'GpoCustomCreate', 'GpoCustomOwner'
$SummaryPermission = Get-GPOZaurrPermissionSummary -IncludePermissionType 'GPOCustom', 'GpoEdit', 'GpoEditDeleteModifySecurity', 'GpoOwner', 'GpoCustomCreate', 'GpoCustomOwner'
# 'GpoRootCreate', 'GpoRootOwner'
$SummaryPermission = Get-GPOZaurrPermissionSummary -IncludePermissionType 'GpoCustom', 'GpoEdit', 'GpoEditDeleteModifySecurity', 'GpoOwner', 'GpoRootCreate', 'GpoRootOwner'
$SummaryPermission | Sort-Object -Property Permission | Format-Table
+4 -4
View File
@@ -1,8 +1,8 @@
function Get-GPOZaurrPermissionRoot {
[cmdletBinding()]
param(
[ValidateSet('GpoCustomCreate', 'GpoCustomOwner')][string[]] $IncludePermissionType,
[ValidateSet('GpoCustomCreate', 'GpoCustomOwner')][string[]] $ExcludePermissionType,
[ValidateSet('GpoRootCreate', 'GpoRootOwner')][string[]] $IncludePermissionType,
[ValidateSet('GpoRootCreate', 'GpoRootOwner')][string[]] $ExcludePermissionType,
[alias('ForestName')][string] $Forest,
[string[]] $ExcludeDomains,
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
@@ -29,10 +29,10 @@
foreach ($Permission in $GPOPermissionsGlobal) {
$CustomPermission = foreach ($_ in $Permission.ActiveDirectoryRights) {
if ($_ -in 'WriteDACL', 'WriteOwner', 'GenericAll' ) {
'GpoCustomOwner'
'GpoRootOwner'
}
if ($_ -in 'CreateChild', 'GenericAll') {
'GpoCustomCreate'
'GpoRootCreate'
}
}
$CustomPermission = $CustomPermission | Sort-Object -Unique
+4 -5
View File
@@ -3,9 +3,8 @@
param(
[validateSet('AuthenticatedUsers', 'DomainComputers', 'Unknown', 'WellKnownAdministrative', 'NotWellKnown', 'NotWellKnownAdministrative', 'NotAdministrative', 'Administrative', 'All')][string[]] $Type = 'All',
[validateSet('Allow', 'Deny', 'All')][string] $PermitType = 'All',
[ValidateSet('GpoApply', 'GpoEdit', 'GpoCustom', 'GpoEditDeleteModifySecurity', 'GpoRead', 'GpoOwner', 'GpoCustomCreate', 'GpoCustomOwner')][string[]] $IncludePermissionType,
[ValidateSet('GpoApply', 'GpoEdit', 'GpoCustom', 'GpoEditDeleteModifySecurity', 'GpoRead', 'GpoOwner', 'GpoCustomCreate', 'GpoCustomOwner')][string[]] $ExcludePermissionType,
[ValidateSet('GpoApply', 'GpoEdit', 'GpoCustom', 'GpoEditDeleteModifySecurity', 'GpoRead', 'GpoOwner', 'GpoRootCreate', 'GpoRootOwner')][string[]] $IncludePermissionType,
[ValidateSet('GpoApply', 'GpoEdit', 'GpoCustom', 'GpoEditDeleteModifySecurity', 'GpoRead', 'GpoOwner', 'GpoRootCreate', 'GpoRootOwner')][string[]] $ExcludePermissionType,
[alias('ForestName')][string] $Forest,
[string[]] $ExcludeDomains,
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
@@ -22,7 +21,7 @@
$IncludePermTypes.Add([Microsoft.GroupPolicy.GPPermissionType]::$PermType)
} elseif ($PermType -in 'GpoOwner') {
$IncludeOwner = $true
} elseif ($PermType -in 'GpoCustomCreate', 'GpoCustomOwner') {
} elseif ($PermType -in 'GpoRootCreate', 'GpoRootOwner') {
$CustomPermissions.Add($PermType)
}
}
@@ -31,7 +30,7 @@
$ExcludePermTypes.Add([Microsoft.GroupPolicy.GPPermissionType]::$PermType)
} elseif ($PermType -in 'GpoOwner') {
$IncludeOwner = $false
} elseif ($PermType -in 'GpoCustomCreate', 'GpoCustomOwner') {
} elseif ($PermType -in 'GpoRootCreate', 'GpoRootOwner') {
$CustomPermissions.Add($PermType)
}
}