now links created groups to project group
This commit is contained in:
parent
42fd038b5d
commit
73b9838b5b
@ -11,10 +11,14 @@ param (
|
|||||||
$Read = 'ACL-'+$ProjectName+'-RO'
|
$Read = 'ACL-'+$ProjectName+'-RO'
|
||||||
$Write = 'ACL-'+$ProjectName+'-RW'
|
$Write = 'ACL-'+$ProjectName+'-RW'
|
||||||
|
|
||||||
|
$ret=@()
|
||||||
|
|
||||||
if($PSBoundParameters.ContainsKey("Server")){
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
New-ADGroup -Path $ACL -Server $Server -Name $Read -GroupCategory Security -GroupScope Global
|
$ret += 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 $Write -GroupCategory Security -GroupScope Global
|
||||||
} else {
|
} else {
|
||||||
New-ADGroup -Path $ACL -Name $Read -GroupCategory Security -GroupScope Global
|
$ret += 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 $Write -GroupCategory Security -GroupScope Global
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $ret
|
@ -11,10 +11,14 @@ param (
|
|||||||
$Read = 'GR-'+$ProjectName+'-RO'
|
$Read = 'GR-'+$ProjectName+'-RO'
|
||||||
$Write = 'GR-'+$ProjectName+'-RW'
|
$Write = 'GR-'+$ProjectName+'-RW'
|
||||||
|
|
||||||
|
$ret=@()
|
||||||
|
|
||||||
if($PSBoundParameters.ContainsKey("Server")){
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
New-ADGroup -Path $Roles -Server $Server -Name $Read -GroupCategory Security -GroupScope Global
|
$ret += 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 $Write -GroupCategory Security -GroupScope Global
|
||||||
} else {
|
} else {
|
||||||
New-ADGroup -Path $Roles -Name $Read -GroupCategory Security -GroupScope Global
|
$ret += 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 $Write -GroupCategory Security -GroupScope Global
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $ret
|
@ -8,13 +8,22 @@ param (
|
|||||||
|
|
||||||
. .\Variables.ps1
|
. .\Variables.ps1
|
||||||
|
|
||||||
|
$ret
|
||||||
|
$acl
|
||||||
|
$r
|
||||||
|
|
||||||
if($PSBoundParameters.ContainsKey("Server")){
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
New-ADGroup -Path $Projects -Server $Server -Name $ProjectName -GroupCategory Security -GroupScope Global
|
$ret = New-ADGroup -Path $Projects -Server $Server -Name $ProjectName -GroupCategory Security -GroupScope Global
|
||||||
. .\AddProjectACL.ps1 -ProjectName $ProjectName -Server $Server
|
$acl = . .\AddProjectACL.ps1 -ProjectName $ProjectName -Server $Server
|
||||||
. .\AddProjectRoles.ps1 -ProjectName $ProjectName -Server $Server
|
$r = . .\AddProjectRoles.ps1 -ProjectName $ProjectName -Server $Server
|
||||||
|
$ret | Add-ADGroupMember -Members $acl,$r
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
New-ADGroup -Path $Projects -Name $ProjectName -GroupCategory Security -GroupScope Global
|
$ret = New-ADGroup -Path $Projects -Name $ProjectName -GroupCategory Security -GroupScope Global
|
||||||
. .\AddProjectACL.ps1 -ProjectName $ProjectName
|
$acl = . .\AddProjectACL.ps1 -ProjectName $ProjectName
|
||||||
. .\AddProjectRoles.ps1 -ProjectName $ProjectName
|
$r = . .\AddProjectRoles.ps1 -ProjectName $ProjectName
|
||||||
|
$ret | Add-ADGroupMember -Members $acl,$r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user