This article describes how to update the XenDesktop Master Image Pooled machine types using PowerShell.
These commands are tested on XenDesktop 5.6 and VMware environment.
Like I said in my pervious article, “PowerShell is a very powerful scripting language that can help automate many aspects of maintaining and deploying a XenDesktop environment.” This saves a lot of time for the Citrix administrators.
Whenever we run a powershell script or command first thing that we should do is to load the Citrix Snapins. If you do not have the Citrix snapins download it from http://www.citrix.com/downloads
This loads the Citrix-specific PowerShell modules. (Asnp means Add-PSSnapin).
Now let’s go with the steps to update the MCS Catalog with the updated master image.
Modify the Master Virtual Machine or new virtual machine with the required changes.
Take a snapshot of the modified virtual machine.
this command provides a mechanism for creating a new snapshot of a virtual machine given a Host Service provider path to a VM.
New-HypVMSnapshot -AdminAddress $XDServername -LiteralPath 'XDHyp:\VMPATH\VMNAME.vm' -SnapshotName "$filename" -SnapshotDescription "$description"
Now to update the Catalog with the latest snapshot that was taken in the Step 2. To get the last snapshot name use the command Get-ChildItem
using the following syntax:
(Get-ChildItem -Recurse -path 'XDHyp:\HostingUnits\Path of the MasterImage.vm').PSPath
This command will list all the snapshots that are taken for the master VM.
To get the path of the Master VM use the command mentioned on Step 4.