now links created groups to project group

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-14 14:26:26 +02:00
parent 42fd038b5d
commit 73b9838b5b
3 changed files with 33 additions and 16 deletions

View File

@ -11,10 +11,14 @@ param (
$Read = 'ACL-'+$ProjectName+'-RO'
$Write = 'ACL-'+$ProjectName+'-RW'
$ret=@()
if($PSBoundParameters.ContainsKey("Server")){
New-ADGroup -Path $ACL -Server $Server -Name $Read -GroupCategory Security -GroupScope Global
New-ADGroup -Path $ACL -Server $Server -Name $Write -GroupCategory Security -GroupScope Global
$ret += New-ADGroup -Path $ACL -Server $Server -Name $Read -GroupCategory Security -GroupScope Global
$ret += New-ADGroup -Path $ACL -Server $Server -Name $Write -GroupCategory Security -GroupScope Global
} else {
New-ADGroup -Path $ACL -Name $Read -GroupCategory Security -GroupScope Global
New-ADGroup -Path $ACL -Name $Write -GroupCategory Security -GroupScope Global
$ret += New-ADGroup -Path $ACL -Name $Read -GroupCategory Security -GroupScope Global
$ret += New-ADGroup -Path $ACL -Name $Write -GroupCategory Security -GroupScope Global
}
return $ret

View File

@ -11,10 +11,14 @@ param (
$Read = 'GR-'+$ProjectName+'-RO'
$Write = 'GR-'+$ProjectName+'-RW'
$ret=@()
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
$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 {
New-ADGroup -Path $Roles -Name $Read -GroupCategory Security -GroupScope Global
New-ADGroup -Path $Roles -Name $Write -GroupCategory Security -GroupScope Global
$ret += New-ADGroup -Path $Roles -Name $Read -GroupCategory Security -GroupScope Global
$ret += New-ADGroup -Path $Roles -Name $Write -GroupCategory Security -GroupScope Global
}
return $ret

View File

@ -8,13 +8,22 @@ param (
. .\Variables.ps1
$ret
$acl
$r
if($PSBoundParameters.ContainsKey("Server")){
New-ADGroup -Path $Projects -Server $Server -Name $ProjectName -GroupCategory Security -GroupScope Global
. .\AddProjectACL.ps1 -ProjectName $ProjectName -Server $Server
. .\AddProjectRoles.ps1 -ProjectName $ProjectName -Server $Server
$ret = New-ADGroup -Path $Projects -Server $Server -Name $ProjectName -GroupCategory Security -GroupScope Global
$acl = . .\AddProjectACL.ps1 -ProjectName $ProjectName -Server $Server
$r = . .\AddProjectRoles.ps1 -ProjectName $ProjectName -Server $Server
$ret | Add-ADGroupMember -Members $acl,$r
} else {
New-ADGroup -Path $Projects -Name $ProjectName -GroupCategory Security -GroupScope Global
. .\AddProjectACL.ps1 -ProjectName $ProjectName
. .\AddProjectRoles.ps1 -ProjectName $ProjectName
$ret = New-ADGroup -Path $Projects -Name $ProjectName -GroupCategory Security -GroupScope Global
$acl = . .\AddProjectACL.ps1 -ProjectName $ProjectName
$r = . .\AddProjectRoles.ps1 -ProjectName $ProjectName
$ret | Add-ADGroupMember -Members $acl,$r
}
return $ret