ProjectManagementScripts/AddProjectRoles.ps1
2024-07-14 14:10:28 +02:00

20 lines
598 B
PowerShell

[CmdletBinding()]
param (
[string]
$ProjectName,
[string]
$Server
)
. .\Variables.ps1
$Read = 'GR-'+$ProjectName+'-RO'
$Write = 'GR-'+$ProjectName+'-RW'
if($PSBoundParameters.ContainsKey("Server")){
New-ADGroup -Path $Roles -Server $Server -Name $Read -GroupCategory Security -GroupScope Global
New-ADGroup -Path $Roles -Server $Server -Name $Write -GroupCategory Security -GroupScope Global
} else {
New-ADGroup -Path $Roles -Name $Read -GroupCategory Security -GroupScope Global
New-ADGroup -Path $Roles -Name $Write -GroupCategory Security -GroupScope Global
}