added functions to make new project groups
This commit is contained in:
parent
8b96445920
commit
1d3240a972
20
AddProjectACL.ps1
Normal file
20
AddProjectACL.ps1
Normal 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
20
AddProjectRoles.ps1
Normal 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
20
NewProject.ps1
Normal 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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user