Documenting a Citrix XenApp 5 Farm with Microsoft PowerShell and Word – Version 4.1

Version 4.1 of the XenApp 5 script was a lot of work and required a lot of testing.  It is my pleasure to release, after three months of intense testing, Version 4.1.  This article will discuss the new features and fixes.

The alphabetical list of new features and fixes:

  • Added additional error checking when retrieving Network Interface WMI data
  • Added beginning and ending dates for retrieving Configuration Logging data
  • Added help text to show the script produces a Word or PDF document
  • Added help text to show the Summary option cannot be used with either the Software or Hardware options
  • Added Parameter sets to support the Summary option
  • Added Summary report option
  • Changed Configuration Logging section to a Word table
  • Changed to using $PSCulture for Word culture setting
  • Don’t abort script if Cover Page is not found
  • For applications, move list of servers to table
  • For the software inventory add DisplayVersion to the table
  • Removed the extra blank line between Administrators

For some virtual servers, sometimes no NIC information is returned and sometimes NIC information “appears” to be returned but the object has no properties.  I added a check to see if any properties are returned and if not, set the $GotNICs variable to $False.  This prevents that section of the script from displaying the ugly red error for every line of output for the NIC hardware section.

If( $Nics -eq $Null )
{
     $GotNics = $False
}
Else
{
     $GotNics = !($Nics.__PROPERTY_COUNT -eq 0)
}

I had several people tell me that in their large environment that the Configuration Logging report adds thousands of pages to the report. I converted this section of the report into a table and added a date range which defaults to the last seven days. Since Citrix provided no help text for showing how to use the dates I provided some in the help text for this script.

.PARAMETER StartDate
 	Start date, in MM/DD/YYYY HH:MM format, for the Configuration Logging report.
 	Default is today's date minus seven days.
 	If the StartDate is entered as 01/01/2014, the date becomes 01/01/2014 00:00:00.
.PARAMETER EndDate
 	End date, in MM/DD/YYYY HH:MM format, for the Configuration Logging report.
 	Default is today's date.
 	If the EndDate is entered as 01/01/2014, the date becomes 01/01/2014 00:00:00.

Example, from the XenApp 6.5 script, using a StartDate of “12/01/2013 00:00” and an EndDate of “12/31/2013 23:59”

Configuration Logging Report as Table

Instead of four history items per page, now there can be around 25.

A feature that several extremely large organizations wanted was a “Management Report” option.  A normal report in an extremely large organization can be thousands of pages long.  While such a lengthy report is useful to the Citrix Admins, Engineers and Architects, for management such a long and large report is useless.  The new -Summary option will produce a report that only includes things such as Administrator names, Application names, Server names, etc.  It will include no detail, no Configuration Logging (History) report and no Appendix A or B.  Help text was added to explain that the Summary parameter cannot be used with the Hardware, Software, StartDate or EndDate parameters.

Changing from using $PSUICulture to $PSCulture is for the non US English Word users.  One thing I have found is if you have multiple language packs installed for Word, the default editing language is what sets $PSCulture.  If you have en-US and xx-XX language packs installed AND you want Word and the script to use xx-XX cover pages and table of contents then xx-XX MUST be set as the default editing language in Word.  Otherwise you can enter –CP SomeCoverPageName” as your cover page and the script will tell you that is not a valid (US English) cover page.  With multiple languages installed in Word, all “Building Blocks.dotx” or “Built-In Building Blocks.dotx” files are retrieved in Word language code order.  Usually this means US English (1033) is first in the array and whatever other language is also used is not first.  This keeps the other language’s cover page from being found since only the first template file in the array is used.  Another change made was to not abort the script if the cover page is not found.  The script will continue to run and produce a report but with no cover page or Table of Contents.

For Applications, the list of servers was moved to a table.  Again, in extremely large environments when the servers are listed in a single column that can add many needless pages to the document.

Before:

Applications Before

After:

Applications After

For the Software Inventory, the DisplayVersion has been added to the table.

Before:

Software Inventory Before

After:

Software Inventory After

I have already been given many suggestions for Version 4.2 of this script the main one being able to include only the sections needed.  For example, producing a report for only Applications and Servers or only for Policies.  I will be taking a break from the XenApp scripts so I can complete the XenDesktop 7 and hopefully the XenDesktop 5 scripts.

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/

Thanks

Webster

About Carl Webster

Webster is a Sr. Solutions Architect for Choice Solutions, LLC 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

No comments yet.

Leave a Reply