ProjectManagementScripts/GetProjectUsers.ps1
Karl-Wilfried Zimmer a9e9495f8a snap
2024-07-14 13:30:12 +02:00

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"