mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-12 19:57:34 +00:00
30 lines
1.2 KiB
PowerShell
30 lines
1.2 KiB
PowerShell
function Add-GPOPermission {
|
|
[cmdletBinding()]
|
|
param(
|
|
[validateset('WellKnownAdministrative', 'Administrative', 'AuthenticatedUsers', 'Default')][string] $Type = 'Default',
|
|
[Microsoft.GroupPolicy.GPPermissionType] $IncludePermissionType,
|
|
[alias('Principal')][Array] $Trustee,
|
|
[alias('PrincipalType')][validateset('DistinguishedName', 'Name', 'Sid')][string] $TrusteeType = 'DistinguishedName'
|
|
)
|
|
if ($Type -eq 'Default') {
|
|
@{
|
|
Action = 'Add'
|
|
Type = 'Standard'
|
|
Trustee = $Trustee
|
|
IncludePermissionType = $IncludePermissionType
|
|
TrusteeType = $TrusteeType
|
|
}
|
|
} elseif ($Type -eq 'AuthenticatedUsers') {
|
|
@{
|
|
Action = 'Add'
|
|
Type = 'AuthenticatedUsers'
|
|
IncludePermissionType = $IncludePermissionType
|
|
}
|
|
} elseif ($Type -eq 'Administrative') {
|
|
@{
|
|
Action = 'Add'
|
|
Type = 'Administrative'
|
|
IncludePermissionType = $IncludePermissionType
|
|
}
|
|
}
|
|
} |