Some admins would like to retrieve a list of virtual Desktops and their assigned user. The console doesn’t provide this.

This little powershell script delivers the required result

Prerequisits

Powershell on the DDC – get be obtained here : Microsoft Powershell Download Page

The XenDesktop Powershell SDK is installed on the DDC  – Reference :
http://support.citrix.com/proddocs/topic/xendesktop-rho/cds-sdk-wrapper-rho.html

(you may need to set the :Set-ExecutionPolicy” cmdlet to adjust the PowerShell execution policy to a value such as “RemoteSigned”)

Display all Desktops and assigned user
add-pssnapin <span class="code-quote">"xdcommands"</span>
$farm = <span class="code-keyword">new</span>-xdadminconnection localhost #<span class="code-keyword">if</span> executed on the DDC
get-xdvirtualdesktop| select-object name,assignedusername