Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Get list of applications
$XAApps = Get-XAApplicationReport -ComputerName $xmlbroker * | where {$_.Enabled -eq $true} | select browsername,accounts
foreach ($app in $XAApps) {
write-verbose $app.browsername
write-verbose (($app.Accounts | select accountname).accountname | out-string)
$isUser = $null
$isGroup = $null
# Application account(s) loop
foreach ($acct in $app.Accounts) {
if ($acct.AccountName -match $accountpattern) {
Write-verbose "$acct is a user account"
$isUser += $acct.AccountName.ToString() + ','
} else {
write-verbose "$acct is an AD group"
if ($acct -match 'Citrix Admins') {
write-verbose "AD Group is Citrix Admins"
} else {
$isGroup += $acct.AccountName.ToString() + ','
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment