I needed to find a way to deploy XenDesktop 5 Desktop Delivery Controller on demand, and the best way to industrialize the auto insertion in a XenDesktop 5 existing site. Of course, as the environment will be very large, I have access to an automation software like Altiris, SCCM etc... You need to know, adding and removing XenDesktop controller from site require some privilege and rights on the database server. In large environment, this is not so easy to gain access to the database servers but at least you'll have the information and the script to send to the SQL DBA. First I install manually the first XenDesktop 5 server to configure database and have everything ready. This is a old XenApp habit and you'll see with the information bellow, you can even industrialize the installation and the site / database creation pretty easily. To do so, there is an executable XenDesktopServerSetup.exe on the DVD (x:\x64\XenDesktop Setup\XenDesktopServerSetup.exe) and if you type /? the information bellow appears : Here is the command line I used to deploy the DDC, without the Web Interface, database and license server, I also have disable the firewall with Active Directory GPOs so I don't use the /configure_firewall option. Don't forget the server where you chose to deploy XenDesktop 5 must be in an Active Directory Domain otherwise the installation will be fine but you won't be able to launch Desktop Studio (many error messages...) Now XenDesktop is installed but not configured. The next steps took me a while because there is no 1,2,3 manual to industrialize the integration of a new XenDesktop 5 server in a site, at least I didn't find any on the net... I wanted to download and install Citrix XenDesktop 5 SDK but it's already install by default with XD5, to check if you can use and access it, launch the PowerShell (Start/All Programs/Accessories/PowerShell) and type Asnp Citrix.* then Get-Command –Module Citrix.* to check if you're able to list all the command available to use. You should see the same list as bellow :   If you have some issue with the security in PowerShell, refer to the build-in help to set the proper level of execution security. To go further with all these Cmdlet, Citrix have online a webpage : CTX127254 where you can read and learn more about each Cmdlet. I made 3 scripts to get the information (1),…