added project group and role getter
This commit is contained in:
parent
4b889563b4
commit
b1e447d652
@ -7,10 +7,12 @@ param (
|
|||||||
|
|
||||||
if($PSBoundParameters.ContainsKey('Name')){
|
if($PSBoundParameters.ContainsKey('Name')){
|
||||||
. .\Variables.ps1
|
. .\Variables.ps1
|
||||||
$Read='GR-'+$Name+'-RO,'
|
$Read='GR-'+$Name+'-RO'
|
||||||
$Write='GR-'+$Name+'-RW,'
|
$Write='GR-'+$Name+'-RW'
|
||||||
Write-Host $Read+$Roles
|
Write-Host $Read+$Roles
|
||||||
Write-Host $Write+$Roles
|
Write-Host $Write+$Roles
|
||||||
|
$ReadUsers=Get-ADGroupMember -Recursive -Identity $Read
|
||||||
|
$WriteUsers
|
||||||
Return $null
|
Return $null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
GetProjects.ps1
Normal file
12
GetProjects.ps1
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[CmdletBinding()]
|
||||||
|
param (
|
||||||
|
[string]
|
||||||
|
$Server
|
||||||
|
)
|
||||||
|
|
||||||
|
. .\Variables.ps1
|
||||||
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
|
Get-ADGroups -Server $Server -SearchBase $Projects
|
||||||
|
} else {
|
||||||
|
Get-ADGroups -SearchBase $Projects
|
||||||
|
}
|
15
GetRoles.ps1
15
GetRoles.ps1
@ -1,3 +1,14 @@
|
|||||||
. .\Variables.ps1
|
[CmdletBinding()]
|
||||||
|
param (
|
||||||
|
[string]
|
||||||
|
$Server,
|
||||||
|
)
|
||||||
|
|
||||||
Get-ADGroup -SearchBase $Roles
|
$Projects
|
||||||
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
|
$Projects = . .\GetProjects.ps1 -Server $Server
|
||||||
|
} else {
|
||||||
|
$Projects = . .\GetProjects.ps1
|
||||||
|
}
|
||||||
|
|
||||||
|
$Projects | Get-ADGroupMember | Where-Object Name -Match "GR.*"
|
Loading…
Reference in New Issue
Block a user