diff --git a/AddProjectACL.ps1 b/AddProjectACL.ps1 new file mode 100644 index 0000000..b7723da --- /dev/null +++ b/AddProjectACL.ps1 @@ -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 +} diff --git a/AddProjectRoles.ps1 b/AddProjectRoles.ps1 new file mode 100644 index 0000000..6bc7417 --- /dev/null +++ b/AddProjectRoles.ps1 @@ -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 +} \ No newline at end of file diff --git a/NewProject.ps1 b/NewProject.ps1 new file mode 100644 index 0000000..055b2f0 --- /dev/null +++ b/NewProject.ps1 @@ -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 +} \ No newline at end of file