-
-
Save alainassaf/22c433756a49e1bfa669d998e14ba2d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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