new project now links GR to ACL

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-14 17:15:12 +02:00
parent 66281abe54
commit 27548c5dc5

View File

@ -8,6 +8,10 @@ param (
. .\Variables.ps1
$ret=$null
$acls=$null
$rs=$null
if($PSBoundParameters.ContainsKey("ProjectName")){
if($PSBoundParameters.ContainsKey("Server")){
$ret = New-ADGroup -Path $Projects -Server $Server -Name $ProjectName -GroupCategory Security -GroupScope Global -PassThru
@ -27,6 +31,24 @@ if($PSBoundParameters.ContainsKey("ProjectName")){
$rs | ForEach-Object {Add-ADGroupMember -Identity $ret -Members $_}
}
if($PSBoundParameters.ContainsKey("Server")){
$target = $acls | Where-Object Name -Match ".*RW"
$member = $rs | Where-Object Name -Match ".*RW"
Add-ADGroupMember -Identity $target -Members $member -Server $Server
$target = $acls | Where-Object Name -Match ".*RW"
$member = $rs | Where-Object Name -Match ".*RW"
Add-ADGroupMember -Identity $target -Members $member -Server $Server
} else {
$target = $acls | Where-Object Name -Match ".*RW"
$member = $rs | Where-Object Name -Match ".*RW"
Add-ADGroupMember -Identity $target -Members $member
$target = $acls | Where-Object Name -Match ".*RW"
$member = $rs | Where-Object Name -Match ".*RW"
Add-ADGroupMember -Identity $target -Members $member
}
return $ret
}