ProjectManagementScripts/AddProjectACL.ps1
2024-07-14 16:45:30 +02:00

27 lines
824 B
PowerShell

[CmdletBinding()]
param (
[string]
$ProjectName,
[string]
$Server
)
. .\Variables.ps1
$Read = 'ACL-'+$ProjectName+'-RO'
$Write = 'ACL-'+$ProjectName+'-RW'
$reta=@()
if($PSBoundParameters.ContainsKey("ProjectName")){
if($PSBoundParameters.ContainsKey("Server")){
$reta += New-ADGroup -Path $ACL -Server $Server -Name $Read -GroupCategory Security -GroupScope Global -PassThru
$reta += New-ADGroup -Path $ACL -Server $Server -Name $Write -GroupCategory Security -GroupScope Global -PassThru
} else {
$reta += New-ADGroup -Path $ACL -Name $Read -GroupCategory Security -GroupScope Global -PassThru
$reta += New-ADGroup -Path $ACL -Name $Write -GroupCategory Security -GroupScope Global -PassThru
}
return $reta
}
throw "ProjectName parameter needs to be set"