-
Documenting a Citrix XenApp 5 Farm with Microsoft PowerShell
October 3, 2011
PowerShell, XenApp, XenApp 5 for Windows Server 2003, XenApp 5 for Windows Server 2008
A customer site I was at recently needed their XenApp 5 farm documented. I remembered reading about Citrix having some PowerShell “stuff” for XenApp 5 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 2000 lines of PowerShell to thoroughly document a XenApp 5 farm.
NOTE: This script is continually updated. You can always find the most current version by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/
This article will focus only on XenApp 5. There is already an article for XenApp 6 and there will be an article for XenApp 6.5.
The prerequisites to follow along with this article are:
- A server, physical or virtual, running Microsoft Windows Server 2003 or Windows Server 2008
- Citrix XenApp 5 for Windows Server 2003 or Windows Server 2008 installed
My lab for this article consists of:
- Windows Server 2008 R2 Domain Controller
- Windows Server 2008 R2 SQL Server
- Windows Server 2003 Standard 32-bit with XenApp 5 and HRP7
- Windows Server 2003 Standard 64-bit with XenApp 5 and HRP7
- Windows Server 2008 Standard 32-bit with XenApp 5 and HRP1
- Windows Server 2008 Standard 64-bit with XenApp 5 and HRP1
The two different XenApp 5 versions are in their own XenApp farm.
In this article, we will be installing the Citrix XenApp Commands Technology Preview (v3).
My initial goal was to see if I could walk down the nodes in the Delivery Services Console (Figure 1), or the Access Management Console (Figure 2), and see if I could document every nook and cranny.
Figure 1 Figure 2 Before we can start using PowerShell to document anything in the XenApp 5 farms we first need to install the XenApp Commands Technology Preview (v3). From your XenApp 5 server, go to https://carlwebster.sharefile.com/d-sfef39096d924298b (Figure 3). Note: A MyCitrix.com login is required.
Figure 3 Click on Download and extract the file to C:\XA5CTP. You can now close your Internet browser.
For a 32-bit server, click Start, Run, type in C:\XA5CTP\Citrix.XenApp.Commands\Citrix.XenApp.Commands.Install_x86.msi and press Enter.
For a 64-bit server, click Start, Run, type in C:\XA5CTP\Citrix.XenApp.Commands\Citrix.XenApp.Commands.Install_x64.msi and press Enter.
Click Run (Figure 4).
Figure 4 Select I accept the terms of this license agreement and click Install (Figure 5).
Figure 5 After a few seconds, the installation completes. Click Finish (Figure 6).
Figure 6 You now have new Start Menu items under All Programs, Citrix. Windows Server 2003 is shown in and Windows Server 2008 is shown in.
Figure 7 Figure 8 The menu item that says Windows PowerShell with XenApp Commands (CTP3) will be the one we use for this article. Click Start, All Programs, Citrix, XenApp Commands, Windows PowerShell with XenApp Commands (CTP3). A PowerShell session starts with the Citrix PowerShell modules already loaded.
16 Responses to “Documenting a Citrix XenApp 5 Farm with Microsoft PowerShell”
Leave a Reply to Bernardo
August 30, 2017 at 5:10 pm
Can I run this script as -HTML or -Text? I don’t have the ability to install on this server.
August 30, 2017 at 7:54 pm
Sorry but no.
Webster
September 23, 2015 at 10:53 am
recently I downloaded XenApp 5 Powershell from http://blogs.citrix.com/2010/09/14/xenapp-5-powershell-sdk-tech-preview-3-released/
After installing it, i observed that the program load approximately 15 to 30 mints
Is there anything that can save my time??
September 23, 2015 at 11:32 am
What program load now takes 15 to 30 minutes?
Webster
April 8, 2015 at 1:07 pm
There is a new link to download the required XenApp commands CTP 3. I got this link from http://blogs.citrix.com/2010/09/14/xenapp-5-powershell-sdk-tech-preview-3-released/. The new link is https://citrix.sharefile.com/d/s2f4bd37f04c4836b.
April 2, 2015 at 9:24 am
Hey Carl, I know this article is referencing older technology (which is actually still being used at my new/current job :)) …. but any idea if I can find anywhere the Powershell SDK for XenApp 5 ???? 🙁 Maybe you have a copy saved somewhere ? Citrix doesn’t offer it anymore.. While I work on the migration to a newer Citrix version, I would still like to be able to monitor/healthcheck the XenApp 5 farms. Thank you much!
April 2, 2015 at 9:30 am
LOL, the Broken Link detector plugin I used just this morning said the links were no longer available. I do have a copy and I have updated the links for CTP3 and CTP4 in the article.
https://dl.dropboxusercontent.com/u/43555945/Citrix.XenApp.Commands.CTP3.zip
https://dl.dropboxusercontent.com/u/43555945/Citrix.XenApp.Commands.CTP4.zip
Webster
April 2, 2015 at 11:14 am
You are the best !!!! thank you so much !!!!
December 13, 2013 at 10:33 am
for some reason I get this error it looks like word is not saving the document
could you shead some light on this
WARNING: Printer driver mapping information could not be retrieved
Unable to find type [Microsoft.Office.Interop.Word.WdSaveFormat]: make sure that the assembly containing this type is l
oaded.
At C:\Users\virtuosoadmin\XA5_Inventory.ps1:4681 char:73
+ $saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat] <<<< , "wdFormatDocumentDefault")
+ CategoryInfo : InvalidOperation: (Microsoft.Offic…rd.WdSaveFormat:String) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
The variable '$SaveFormat' cannot be retrieved because it has not been set.
At C:\Users\virtuosoadmin\XA5_Inventory.ps1:4682 char:45
+ $doc.SaveAs([REF]$filename, [ref]$SaveFormat <<<< )
+ CategoryInfo : InvalidOperation: (SaveFormat:Token) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined
December 16, 2013 at 5:40 pm
What OS is XenApp 5 running under?
What version of Word?
What version of the script?
Thanks
Webster
September 21, 2012 at 2:25 am
Does this work also on PS 4.5?
September 21, 2012 at 5:24 am
Yes it does since PS4.5 and XenApp 5 are the same product.
Thanks
Webster
May 15, 2012 at 2:48 am
Hi Carl,
Fanatastic script for reporting on XenApp 5 Farms.
I have a requierement for reporting on a few servers, which are fairly easy to get at because they are in alphabetical order, but the applications are not.
To make a long story a very short one.
I have to get a report about applications and the configurations, but only from a few servers.
I have managed to modify the script to have a report with only the application reporting. What I haven’t been succesful in is instead of having the application being ordered, having the servers being ordered.
Any ideas???
Thanks!!!
May 15, 2012 at 6:27 am
Send me the script you have, as a TXT file, and I will see what you have and make suggestions for you.
webster@carlwebster.com
Thanks
March 27, 2012 at 12:35 pm
Great script! I didn’t include the conf logging part and I still got a 841 page document about my XA 4.5 HRP 07 farm. I have one rather minor question since I am new to PowerShell, can the policies be returned in priority order instead of alphabetically?
March 27, 2012 at 12:48 pm
I believe that is doable. Change this line:
$Policies = Get-XAPolicy -EA 0 | sort-object PolicyName
to
$Policies = Get-XAPolicy -EA 0 | sort-object Priority
Thanks
Webster