Documenting a Citrix XenApp 6 Farm with Microsoft PowerShell

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 Send Farm Server & Application Inventory By Email — XA6 PS Script located at http://community.citrix.com/pages/viewpage.action?pageId=148703582. 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.

This article will focus only on XenApp 6. There will be additional articles for XenApp 5 and XenApp 6.5.

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.

Figure 1

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).

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.

Figure 3

Extract the file to C:\XA6SDK. Click Start, Run, type in C:\XA6SDK\XASDK6.0.exe and press Enter (Figure 4).

Figure 4

Click Run (Figure 5).

Figure 5

Select I accept the terms of this license agreement and click Next (Figure 6).

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.

Figure 7

Click Install (Figure 8).

Figure 8

After a few seconds, the installation completes. Click Finish (Figure 9).

Figure 9

Back in your Internet browser; go to http://tinyurl.com/XenApp6PSPolicies (Figure 10).

Figure 10

Scroll down and click on Citrix.GroupPolicy.Commands.psm1 (Figure 11).

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)

Figure 12

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)

Figure 14

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 .

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).

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).

Figure 18

,

About Carl Webster

Webster is an independent consultant in the Nashville, TN area and specializes in Citrix, Active Directory and Exchange. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

View all posts by Carl Webster

3 Responses to “Documenting a Citrix XenApp 6 Farm with Microsoft PowerShell”

  1. Tom K. Says:

    Wow. I worked alongside the article for the first pages and was having success in my own environment as I tried to duplicate the sample pieces of posh code. A good way to learn, but then I looked ahead and upon seeing the sheer amount of code-yet-to-come I jumped to the last page and was relieved to see it had been all put together and made available for donwload.

    Not being a coder or developer by nature or proefession I am always looking for examples I can emulate and hopefully learn from,but in this case I was going to be happy if I could download some or all of this and just have it handy. I can’t tell you though how amazed I was when the entire final script with all of those components contained within ran the first time I tried it in my environment on a XA6 server with the SDK installed. It’s never that easy, at least never has been before when I’ve copied other’s scripts. This is a testament to Mr. Webster’s attention to detail and thoroughness. Thanks man.

    Reply

Trackbacks/Pingbacks

  1. Documenting a Citrix XenApp 6 Farm with Microsoft PowerShell « Roshan Ratnayake – Solution Architect - December 22, 2011

    [...] Awesome Script to document XenApp 6 Farm.. Read the full story here :http://carlwebster.com/documenting-a-citrix-xenapp-6-farm-with-microsoft-powershell/ [...]

Leave a Reply