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