This message was deleted.
# citrix-vad
s
This message was deleted.
n
I wrote a script to get the users and groups assigned to a DG, yes. See if this is what you're looking for (it has some extra info):
Copy code
$ErrorActionPreference = 'SilentlyContinue'
Clear-Host

$Log = ".\CTX-GetDGUsers.csv"
$Results = New-Object System.Collections.ArrayList
$Results.Add("Broker,DG,Username,Name,Email") | Out-Null

$Brokers = "CTXBROKER1","CTXBROKER1"

ForEach ($Broker in $Brokers) {
	$DGs = (Get-BrokerDesktopGroup -AdminAddress $Broker | Where {$_.Name -like "*GroupName1*" -and $_.Name -notlike "*UAT*"}).Name
	ForEach ($DG in $DGs) {
		Write-Host "Querying " -NoNewLine; Write-Host "$DG" -ForegroundColor Green -NoNewLine; Write-Host " on " -NoNewLine; Write-Host "$Broker" -ForegroundColor Green
		$Users = (Get-BrokerAccessPolicyRule -AdminAddress $Broker -DesktopGroupName $DG | Select -ExpandProperty IncludedUsers).Name | Select -Unique
		ForEach ($User in $Users) {
			$ADDomain,$ADUsername = $User.Split('\')
			$ADUser = Get-ADUser $ADUsername -Property * -Server $ADDomain
			$DisplayName = $ADUser.DisplayName
			$Email = $ADUser.Mail
			$Results.Add("$Broker,$DG,$User,""$DisplayName"",$Email") | Out-Null
			$ADUser = $Null
		}
		$Users = $Null
	}
	$DGs = $Null
}
$Broker = $Null
$Results | Out-File -Append $Log
👏 2