Automated Citrix XenDesktop Site Configuration
In my last blog post Running a Citrix lab in Amazon AWS I showed you how to configure a Citrix XenApp / XenDesktop site and databases unattended with Powershell.
This script is a perfect match for my Automation Framework, but the problem is the Microsoft Deployment Toolkit (MDT). When MDT performs installations, they´re all launched with the local administrator account. So if you just add the script as an application / task sequence the configuration will fail because the logged on administrator account is not a domain account.
The workaround is to use the Run Command Task Sequence and specify the domain account you want it to run as.
Use the following commands:
powershell.exe -ExecutionPolicy Bypass -Command "Copy-Item '%DEPLOYROOT%ApplicationsCitrix XenDesktop 7.6Configure_XA.ps1' -destination C:WindowsTemp; C:WindowsTempConfigure_XA.ps1; Remove-Item C:Windowstemp*.ps1 -Force"
Remember that this only applies to your first Delivery Controller, after that you use the following commands to join a new Delivery Controller to an existing site.
$logFile = "C:WindowsTempJoin_XA.log" Start-Transcript $logFile Write-Output "Logging to $logFile" Add-PSSnapin Citrix.* Add-XDController -AdminAddress localhost -SiteControllerAddress xadc-01.ctxlab.local Stop-Transcript