• Conversant Group
    Conversant Group

    Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 4.1

    January 20, 2014

    PowerShell, PVS

    I have a confession to make, the only reason there is a Version 4.1 of the PVS script is just to bring a few fixes from the XenApp scripts over and have all the documentation scripts have the same fixes.  I get a LOT of feature requests for the XenApp scripts (mainly the XenApp 6.5 script) but I have never received a feature request or bug report for the PVS script.  This article will discuss the few fixes in Version 4.1.

    The alphabetical list of new features and fixes:

    • Added additional error checking when retrieving Network Interface WMI data
    • Added help text to show the script produces a Word or PDF document
    • Changed to using $PSCulture for Word culture setting
    • Don’t abort script if Cover Page is not found

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

    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.

    NOTE:  You can always find the most current version of this script by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

    Thanks

    Webster







    Conversant Group
    Conversant Group

    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

    7 Responses to “Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 4.1”

    1. Paul Says:

      Hi Carl,

      Thank you for the XenApp 6.5 script this worked a charm remotely once I found out that the service that allows remote commands had stopped.

      I now need to document PVS, but I cannot find how to run the script remotely as I cannot see anything in the 4.1 ReadMe. Am I being blind?

      Thank you
      Paul

      Reply

      • Carl Webster Says:

        Oops, I need to add this to the ReadMe file.

        https://carlwebster.com/using-my-citrix-pvs-powershell-documentation-script-with-remoting/

        Thanks

        Webster

        Reply

        • Paul Says:

          Thank you Carl, I managed to get it working. The only issue I had was that if I just used the Server variable it didn’t work, but if I used Port as well (even though it was default) it worked a charm.

          I do have an issue in the script though: at line 4439

          Property ‘storeName’ cannot be found on this object. Make sure that it exists.

          This is definitely populated in the PVS console.

          Thank you again for your script and help
          Citrix Newbie – Paul

          Reply

          • Carl Webster Says:

            I am checking 2 store names on that line. The first is the Server’s store name and the 2ns id the Stores store name. Which one is getting the error?

            Thanks

            Webster

            Reply

    2. Anthony Says:

      Hello Webster,

      Is it possible to run the command on a server without Word installed? We don’t want to install Word on the Citrix PVS Server?

      Hope to here from you.

      Reply

      • Carl Webster Says:

        The ReadMe file shows how to run the script remotely. That feature was added a while back.

        You can install the PVS requirements on a PC (that has Word installed) and run the script from the PC remotely against a PVS server.

        Thanks

        Webster

        Reply

    Leave a Reply