added functions to make new project groups

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-14 14:01:22 +02:00
parent 8b96445920
commit 1d3240a972
3 changed files with 60 additions and 0 deletions

20
AddProjectACL.ps1 Normal file
View File

@ -0,0 +1,20 @@
[CmdletBinding()]
param (
[string]
$ProjectName,
[string]
$Server
)
. .\Variables.ps1
$Read = 'ACL-'+$ProjectName+'-RO'
$Write = 'ACL-'+$ProjectName+'-RW'
if($PSBoundParameters.ContainsKey("Server")){
New-ADGroup -Path $ACL -Server $Server -Name $Read
New-ADGroup -Path $ACL -Server $Server -Name $Write
} else {
New-ADGroup -Path $ACL -Name $Read
New-ADGroup -Path $ACL -Name $Write
}

20
AddProjectRoles.ps1 Normal file
View File

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

20
NewProject.ps1 Normal file
View File

@ -0,0 +1,20 @@
[CmdletBinding()]
param (
[string]
$ProjectName,
[string]
$Server
)
. .\Variables.ps1
if($PSBoundParameters.ContainsKey("Server")){
New-ADGroup -Path $Projects -Server $Server -Name $ProjectName
. .\AddProjectACL.ps1 -ProjectName $ProjectName -Server $Server
. .\AddProjectRoles.ps1 -ProjectName $ProjectName -Server $Server
} else {
New-ADGroup -Path $Projects -Name $ProjectName
. .\AddProjectACL.ps1 -ProjectName $ProjectName
. .\AddProjectRoles.ps1 -ProjectName $ProjectName
}