Citrix-Powershell

#I am an absolute poweshell Beginner#. I am trying to run below script to be able to get the AD accounts and applications table if i input a few Citrix servers . It throws System.NullReferenceException error twice and misses out a few applications at the top row and gives the result that i need for rest of the apps

$sers = get-content .\ser.txt
$apps = foreach ($server in $sers) { Get-XAApplication -servername $server | select displayname }
$apps | export-csv .\apps.csv

$appz = Get-Content .\apps.csv
foreach ($app in $appz) { Get-XAAccount -BrowserName $app | select accountdisplayname, @{n = ‘ApplicationName’ ; e = {$app} } }

Help!

The problem here is you are not asking AD for anything. Well, you are not showing that you are in this post.

Now, full disclosure, I am not a Citrix user and of course never eve seen the Citrix admin experience.

If these Citirix server are not part of AD, then they cannot be returned. AD, of course does not store application information, the server does.

SO, yes, you can pull server name, etc., from AD, but you have to either user PoSH to ask for product names of installed application from the Control Panel or the registry.

Taking that this Citrix designed ‘Get-XAApplication cmdlet’ is doing the work that say Get-ADComputer and ‘Get-WmiObject -Class Win32_Product’ would be doing. I am wondering what are all the parameters in that ‘Get-XAApplication cmdlet’ and what does the examples show.

Get-Help -Name ‘Get-XAApplication’ -Examples
Get-Help -Name ‘Get-XAApplication’ -Full

Yet, a quick search on the Citrix forum shows this…
discussions.citrix.com/topic/335193-help-with-powershell-script-for-listing-applications-and-servers