Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell and Word – Version 4

Version 4 of the Citrix XenApp 6.5 script has been released.  Version4  adds several new features along with support for 11 language versions of Microsoft Word 2007, 2010 and 2013.  There is now a separate ReadMe file for the Version 4 script.

Before I get started listing all the new features and fixes, I want to start by thanking a dedicated and hardworking group of testers and others who provided PowerShell help and guidance for developing Version 4.

  • Christian Hackmann
  • Citrix Engineering Team
  • Claudio Rodrigues
  • David O’Brien
  • Eelco de Vries
  • Jarian Gibson
  • James Ma
  • Javier Sanchez Alcazar
  • Kees Baggerman
  • Markus Irmer
  • Markus Zehnle
  • Martin Therkelsen
  • Michael Rueefli
  • Mike Fry
  • Mike Nelson
  • Nick Cookendorfer
  • Olav Lillebo
  • Patrick Seymour
  • Roy Textor
  • Russell Fox
  • Shaun Ritchie
  • Thomas Daugaard
  • Vladimir Radojevic
  • Wilco van Bragt

I will create separate articles for most of the new features to keep this article from becoming a novel.  Here is a list of the new features, changes and fixes.

  • Add ability to process Active Directory based Citrix policies
  • Add Appendix A for Session Sharing information
  • Add Appendix B for Server Major Items
  • Add descriptions for Citrix Policy filter type
  • Add detecting the running Operating System to handle Word 2007 oddness with Server 2003/2008 vs Windows 7 vs Server 2008 R2
  • Add elapsed time to end of script
  • Add extra testing for applications, load balancing policies and worker groups to report if none exist instead of issuing a warning
  • Add get-date to all write-verbose statements
  • Add missing “None” option to ICA\Visual Display\Moving Images\Progressive compression level
  • Add more Write-Verbose statements
  • Add option to SaveAs PDF
  • Add setting Default tab stops at 36 points (1/2 inch in the USA)
  • Add Software Inventory
  • Add Summary Page
  • Add support for non-English versions of Microsoft Word
  • Add WMI hardware information for Computer System, Disks, Processor and Network Interface Cards
  • Change all instances of using $Word.Quit() to also use proper garbage collection
  • Change all occurrences of Access Session Conditions to Tables
  • Change Default Cover Page to Sideline since Motion is not in German Word
  • Change Get-RegistryValue function to handle $null return value
  • Change most $Global: variables to regular variables
  • Change the test for the existence of XA65ConfigLog.udl from using .\ to $pwd.path
  • Change wording of not being able to load the Citrix.GroupPolicy.Commands.psm1 module
  • Change wording when script aborts from a blank company name
  • Fix issues with Word 2007 SaveAs under (Server 2008 and Windows 7) and Server 2008 R2
  • Fix logic error when comparing Citrix installed hotfixes to the recommended list
  • Fix output and missing items from ICA\Printing\Client Printers\Printer driver mapping and compatibility
  • Fix output of ICA\Adobe Flash Delivery\Flash Redirection\Flash URL compatibility list
  • Fix output of ICA\MultiStream Connections\Multi-Port Policy
  • Fix output of ICA\Printing\Drivers\Universal driver preference
  • Fix output of ICA\Printing\Session printers
  • Fix output of ICA\Printing\Universal Printing\Universal printing optimization defaults
  • Fix output of Server Settings\Health Monitoring and Recovery\Health monitoring tests
  • Fix WaitForPrintersToBeCreated policy setting
  • Fixing ICA\Printing\Session printers and ICA\Printing\Client Printers\Printer driver mapping and compatibility  required a new Function Get-PrinterModifiedSettings to keep from having duplicate code from Session Printers
  • Abort script if Farm information cannot be retrieved
  • Align Tables on Tab stop boundaries
  • Consolidated all the code to properly abort the script into a function AbortScript
  • Force the -verbose common parameter to be $True if running PoSH V3 and later
  • General code cleanup
  • If cover page selected does not exist, abort script
  • If running Word 2007 and the Save As PDF option is selected then verify the Save As PDF add-in is installed.  Abort script if not installed.
  • In the Server section, change Published Application to a Table
  • Load Balancing Policies: fixed display of “Apply to connections made through Access Gateway” and “Configure application connection preference based on worker group”
  • Only process WMI hardware information if the server is online
  • Strongly type all possible variables
  • Update for changes to CTX129229
  • Verify Get-HotFix cmdlet worked.  If not, write error and suggestion to document
  • Verify Word object is created.  If not, write error & suggestion to document and abort script

By far the #1 most requested feature to add to the XenApp 6 and XenApp 6.5 scripts has been the ability to process Active Directory based Citrix Policies.  Thanks to the Citrix Engineering Team and Michael B. Smith for helping solve this.

Appendix A will show Session Sharing information taken from CTX159159 and also what is used to generated the Session Sharing Key.  Since most of the items that make up Session Sharing and the Session Sharing Key are policy based, their affect on Session Sharing cannot be determined at the time the documentation script is run.  Therefore the script can only use the application based settings.

Appendix B will show server major items including whether Session Sharing has been disabled at the server level as explained in CTX159159.

For some very large environments, the script can take hours, days or more than a week to run!  Some people are curious how long the script takes to run so I added an elapsed time at the very end of the script (where else?).

Also, for those where the script can take an extremely long time to run, they complained there wasn’t enough information being displayed in the PowerShell session to let them know if the script was running or hung.  I have added many more Write-Verbose statements and added the date and time to the beginning of each.

Saving as a PDF has been requested often.  In my lab, the PDF file can be 5x to 10x larger than the DOCX file.  If you are running Word 2007, you will need the Microsoft Save as PDF add-in.  Saving as PDF is disabled by default.

There is now an optional parameter, -Software, that will provide software information on each XenApp server.  This parameter is disabled by default.  To keep the software inventory from including every piece of software installed on a server, there is a SoftwareExclusion.txt file that contains a list of software to exclude.  See the ReadMe file for more details.

While speaking at the vCommunity events in the Northeast USA put on by Robert Morris and the fine folks at Advantec Global Services, Inc (http://www.advantec.us/), several script users asked if I could add a Summary Page at the end of the script.  They said their managers often asked for data on how many administrators, published resources, policies, etc were used in a particular XenApp farm.  That was easy to do so I added it while waiting to speak in Philadelphia.  Some input from Mr. App-V Tim Mangan on the report layout and it was done.  I am also making this Summary Page available as a separate script.

When versions of the various documentation scripts that created a Word document were released, it didn’t take but a few minutes before I heard from my French and German script users.  The scripts only worked on English versions of Word.  No more.  Version 4 supports 11 language versions of Microsoft Word.  The following languages are supported:

  • Catalan
  • Danish
  • Dutch
  • English
  • Finnish
  • French
  • German
  • Norwegian
  • Portuguese
  • Spanish
  • Swedish

There is now an optional parameter, -Hardware, that will provide hardware information on each PVS server.  This parameter is disabled by default.

The default Cover Page of Motion had to be changed to Sideline as Motion does not exist in German Word.  Since I have no idea what version of Word or what language version of Word you are using before the script starts, I have to detect if the default Cover Page Sideline was selected and then change it to the language specific name in the script.

If you are running PowerShell version 3 or 4, the $Verbose variable is set to $True automatically.  Therefore you are not required to use the -verbose switch to turn on the Write-Verbose statements.

I strongly typed as many variables as possible.  To me this just makes the code easier to read and helps prevent using a variable incorrectly in different parts of the script.

One of the problems with using PowerShell code from well known PowerShell gurus is that they rarely use error-checking in their code.  I had issues that were found with some of the new testers.  “Things” that had always worked, no longer worked.  For example, creating the $Word variable using Word COMObject.  I had one tester where Word appeared to work fine but the script would not create the $Word variable.  It turned out to be a corrupt Word install on his computer.  He ran a repair of Word and then the script ran with no issues.  But what I really needed to do was add a test to make sure the $Word variable was successfully created and if not, abort the script.

This also happened when using the built-in Microsoft Get-Hotfix cmdlet.  This cmdlet is just a wrapper around WMI.  For one tester, this cmdlet failed for all servers built from one common image.  That turned out to be a corrupt WMI repository.  Again, I should have had error checking in my script for this.  I now do.

These last two issues caused me to go through the script and add more error checking.

This is just a very quick overview of some of the changes in Version 4 of the XenApp 6 script.  I will be writing separate articles to cover some of these changes in greater detail.

I hope you enjoy V4. You can download the scripts by going to this link.  http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Thanks

Webster

About Carl Webster

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

View all posts by Carl Webster

2 Responses to “Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell and Word – Version 4”

  1. julien sybille Says:

    Carl, I try to run the script in a French server and that is not working

    you should add the French section for populate the $hash in the Switch section

    Switch ($PSUICulture.Substring(0,3))
    {
    ‘fr-’ {
    $hash.($($PSUICulture)) = @{
    ‘Word_TableOfContents’ = ‘Sommaire Automatique 2′;
    }
    }

    Reply

    • Carl Webster Says:

      WOaw, I sure thought that was in there from the beginning as French and German were the first languages I added. I will get this fixed ASAP.

      Webster

      Reply

Leave a Reply

Current month ye@r day *