A customer site I was at recently needed their new XenApp 6 farm documented. I remembered reading about Citrix having some PowerShell “stuff” for XenApp 6 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 1600 lines of PowerShell to thoroughly document a XenApp 6 farm.
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 installed
In this article, we will be installing:
- Citrix XenApp 6 Software Developers Kit (SDK)
- Citrix Group Policy PowerShell Commands
My initial goal was to see if I could walk down the nodes in the Delivery Services Console (Figure 1), or AppCenter (the current Citrix terminology), and see if I could document every nook and cranny.
Before we can start using PowerShell to document anything in the XenApp 6 farm we first need to install the SDK and Citrix Group Policy commands. From your XenApp 6 server, go to http://tinyurl.com/XenApp6PSSDK (Figure 2).
Scroll down and click on Download XenApp 6 Powershell SDK — Version 6.1.2 (Figure 3). Do not exit your Internet browser at this time.
Extract the file to C:\XA6SDK. Click Start, Run, type in C:\XA6SDK\XASDK6.0.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.
You now have two new Start Menu items under All Programs, Citrix:
- Windows PowerShell with Citrix XenApp Server SDK (x86) (Figure 14)
- Windows PowerShell with Citrix XenApp Server SDK (Figure 15)
The one shown in Figure 15 is 64-bit and will be the one we use for this article. Click Start, All Programs, Citrix, XenApp Server SDK, Windows PowerShell with Citrix XenApp Server SDK. You should see the message shown in Figure 16 .
This message is asking if you want to trust the PowerShell scripts from Citrix. Type the letter A and press Enter. You will see the Citrix PowerShell scripts and modules load (Figure 17).
To prepare for processing the Citrix farm policies, type in import-module Citrix.GroupPolicy.Commands, press Enter, type the letter A and press Enter (Figure 18).