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