ProjectManagementScripts/GetProjectUsers.ps1
2024-07-14 16:57:49 +02:00

20 lines
474 B
PowerShell

# Parameter help description
[CmdletBinding()]
param (
[string]
$Name,
[string]
$Server
)
if($PSBoundParameters.ContainsKey('Name')){
$Roles=$null
if($PSBoundParameters.ContainsKey('Server')){
$Roles = . .\GetRoles.ps1 -Server $Server | Where-Object Name -Match $Name
} else {
$Roles = . .\GetRoles.ps1 | Where-Object Name -Match $Name
}
return $Roles | Get-ADGroupMember | Get-Unique
}
throw "No such Project was found"