22 lines
534 B
PowerShell
22 lines
534 B
PowerShell
# Parameter help description
|
|
[CmdletBinding()]
|
|
param (
|
|
[string]
|
|
$Name,
|
|
[string]
|
|
$Server
|
|
)
|
|
|
|
if($PSBoundParameters.ContainsKey('Name')){
|
|
$Read='GR-'+$Name+'-RO'
|
|
$Write='GR-'+$Name+'-RW'
|
|
$Roles
|
|
if($PSBoundParameters.ContainsKey('Server')){
|
|
$Roles = . .\GetRoles.ps1 -Server $Server | Where-Object Name -Match $Name
|
|
} else {
|
|
$Roles = . .\GetRoles.ps1 | Where-Object Name -Match $Name
|
|
}
|
|
return $Users = $Roles | Get-ADGroupMember | Get-Unique
|
|
}
|
|
|
|
throw "No such Project was found" |