ProjectManagementScripts/GetProjectUsers.ps1

20 lines
468 B
PowerShell
Raw Normal View History

2024-07-14 11:44:34 +02:00
# Parameter help description
[CmdletBinding()]
param (
[string]
2024-07-14 13:30:12 +02:00
$Name,
[string]
$Server
2024-07-14 11:44:34 +02:00
)
if($PSBoundParameters.ContainsKey('Name')){
2024-07-14 13:30:12 +02:00
$Roles
if($PSBoundParameters.ContainsKey('Server')){
$Roles = . .\GetRoles.ps1 -Server $Server | Where-Object Name -Match $Name
} else {
$Roles = . .\GetRoles.ps1 | Where-Object Name -Match $Name
}
2024-07-14 13:33:45 +02:00
return $Roles | Get-ADGroupMember | Get-Unique
2024-07-14 11:44:34 +02:00
}
throw "No such Project was found"