Export a list of XenDesktop VDIs to CSV with PowerShell

Export a list of XenDesktop VDIs to CSV with PowerShell
Have you ever wanted to export a list of XenDesktop VDIs to CSV with PowerShell?

I wanted to do this just recently but had trouble finding the relevant info, so hopefully this helps someone out.

Make sure you have the Citrix Powershell SDK installed. The PowerShell SDK is installed by default on XenDesktop 5 Controllers.

From the Citrix Knowledge Center article Getting Started with PowerShell in XenDesktop 5

Begin a PowerShell session by clicking the blue icon on the taskbar or browsing to Start > All Programs > Accessories > Windows PowerShell > Windows PowerShell (On 64-bit systems, this starts the 64-bit version. Either the 32-bit or 64-bit versions will work fine though.)

Type Asnp Citrix.* and press Enter. This loads the Citrix-specific PowerShell modules. (Asnp is short for Add-PSSnapin).
Run the Citrix cmdlets.
To list all of the ones available, run Get-Command –Module Citrix.*

Help might be obtained on any cmdlet by running Get-Help <cmdlet> such as Get-Help Get-BrokerDesktop (additional details might be obtained by adding on the –examples, -detailed, or –full switches)

The command you want to export a list of XenDesktop VDIs to CSV with PowerShell is as follows:

Get-BrokerDesktop -AdminAddress servername -MaxRecordCount 1000 -DesktopKind Private | sort desktopgroupname | export-csv “outputfile.csv

Items in bold can be changed to required values.

Hope this saves you some time searching!

Troubleshoot problematic sessions using Citrix UPM

stuck session
Did you know you can Troubleshoot problematic sessions using Citrix UPM?

You can! Citrix User Profile Manager keeps useful logs on lots of things but wht you may not realise is that it also keeps a log of the last servers a user successfully logged in to.
This info can be useful for troubleshooting stuck sessions and profile issues, especially when your Citrix Delivery Services Console isn’t forthcoming in showing the session that is stuck.

When you get users calling and reporting they can’t log in or are having issues with their profile just have a look inside the users citrix upm profile at their PMCompatibility.ini file.
This will show you the last server the user logged in to, and from there you can see if their session quit properly or if there is a lock on any files in their profile on that server that stopped it unloading.