A customer site I was at recently needed their new XenApp 6.0 farm documented. I remembered reading about Citrix having some PowerShell “stuff” for XenApp 6.0 so I started searching. I came across a short article by Michael Bogobowicz Getting a Farm Inventory With XenApp 6 PowerShell Scripting. That short article really piqued my interest. I took Michael’s little script as the starting point to learn Microsoft’s PowerShell. With some help from PowerShell MVP and fellow CTP Brandon Shell and a lot of help from Exchange MVP Michael B. Smith, I turned the original script into over 1800 lines of PowerShell to thoroughly document a XenApp 6 farm. For this article, I will update the original XenApp 6.0 documentation script for XenApp 6.5.
NOTE: This script is continually updated. You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/
The prerequisites to follow along with this article are:
- A server, physical or virtual, running Microsoft Windows Server 2008 R2 with or without SP1
- Citrix XenApp 6.5 installed
The nice thing about XenApp 6.5 compared to both XenApp 5 and XenApp 6 is that all the basic Citrix PowerShell stuff is installed when you install XenApp 6.5. But we still need the XenApp 6.5 PowerShell Help and the Citrix Group Policy PowerShell Commands.
My initial goal was to see if I could walk down the nodes in the AppCenter (Figure 1) and see if I could document every nook and cranny.
Before we can start using PowerShell to document anything in the XenApp 6.5 farm we first need to install the SDK (for the Help file) and Citrix Group Policy commands. From your XenApp 6.5 server, go to http://tinyurl.com/XenApp65PSSDK (Figure 2).
Scroll down and click on Download XenApp 6.5 Powershell SDK — Version 6.5 (Figure 3). Do not exit your Internet browser at this time.
Extract the file to C:\XA65SDK. Click Start, Run, type in C:\XA65SDK\XASDK6.5.exe and press Enter (Figure 4).
Click Run (Figure 5).
Select I accept the terms of this license agreement and click Next (Figure 6).
Select Update the execution policy (to AllSigned) and Click Next (Figure 7).
Note: If you do not update the execution policy to AllSigned, the Citrix supplied XenApp PowerShell scripts will not load.
Click Install (Figure 8).
After a few seconds, the installation completes. Click Finish (Figure 9).
Back in your Internet browser; go to http://tinyurl.com/XenApp6PSPolicies (Figure 10).
Scroll down and click on Citrix.GroupPolicy.Commands.psm1 (Figure 11).
Save the file in two different places:
C:\Windows\System32\WindowsPowerShell\v1.0\Modules, in a new folder named Citrix.GroupPolicy.Commands (Figure 12)
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules, in a new folder named Citrix.GroupPolicy.Commands (Figure 13)
You can now close your Internet browser.
Click Start, Administrative Tools, Windows PowerShell Modules.
To prepare for processing the Citrix farm policies, type in import-module Citrix.GroupPolicy.Commands and press Enter.