Did you know that with the release of XD7 a new high level administrative PoSH module was introduced for the first time? Just like XDs regular PoSH snapins, this new module i.e. the aptly titled XenDesktop PowerShell module can be used to configure and administer an XD site.
The supporting files for this new module can be found in the following location:
Note: The location above also includes two nice help files which explain the purpose of the new module and how the module can be used to carry out initial configuration of a Site.
Prior to XD7 we only used snapins to extend the shell but as Microsoft now recommends using modules over snapins (which are being depreciated) we need to follow suit and the new XenDesktop module is one of the first examples of this that I have come across.
So how do we interact with this new module? Basically all you have to do is load the module (It’s not loaded automatically when launching PoSH through Citrix Studio). Personally I prefer using a standalone instance of PoSH anyway and manually loading the XD snapins so an extra manual step doesn’t really bother me. For all the crazy scripting dudes out there I suppose this is a moot point anyway…
So now that you know about this new PoSH module, go ahead and follow the simple steps below to view and load the new XenDesktop PoSH module:
Step 1: To view all the available PoSH modules on your system run the following command from within a PoSH window:
Step 2: To import the XenDesktop module into the existing PoSH session, use the following string:
Import-Module -name Citrix.XenDesktop.Admin -verbose (the verbose switch just shows you what cmdlets are loaded)
Once loaded, check out some of the available cmdlets which can be used to configure and administer your XD site…
One of the big advantages with using modules over snapins is that modules can contain PoSH commands in the form of cmdlets, functions and worksflows and can also contain variables, aliases and providers so that you can return the information stored in different parts of the database using one simple command rather then 2 or 3 seperate commands:
Example: Running Get-XDSite in XD7 returns information from the database that would normally only be retreivable using a couple of cmdlets:
Get-BrokerSite (Site Name, LicenseInformation)
Mick Glover (aka XD Tipster)
Senior Readiness Specialist, Worldwide Support Readiness [EMEA]
Citrix Systems, Inc.