ProjectManagementScripts/GetProjectUsers.ps1

22 lines
534 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:01:03 +02:00
$Read='GR-'+$Name+'-RO'
$Write='GR-'+$Name+'-RW'
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
}
return $Users = $Roles | Get-ADGroupMember | Get-Unique
2024-07-14 11:44:34 +02:00
}
throw "No such Project was found"