• Documenting Citrix XenDesktop 5.x with Microsoft PowerShell V1.1

    April 2, 2015

    PowerShell, XenDesktop 5.x

    While developing the Citrix XenDesktop 7.x documentation script, I added several enhancements, cleaned up the verbose console output and added aliases to some of the parameters. With the help of Eduardo Molina, a Delivery Group Utilization chart has been added.

    There are four new parameters:

    1. NoPolicies, excludes all policy information from the output document.
    2. NoAdPolicies, excludes all Active Directory Citrix based policies.
    3. Hardware, adds hardware information for the Controller(s).
    4. DeliveryGroupUtilization, inserts a chart for Delivery Group utilization. Excel is required for this feature.

    If both Policies and NoPolicies are used, preference is given to NoPolicies.

    If Policies is specified and the Citrix.GroupPolicy.COmmands.psm1 module cannot be loaded, the script will abort.

    Aliases have been added for the following parameters:

    • Policies (Pol)
    • NoPolicies (NP)
    • NoADPolicies (NoAD)
    • Hosting (Host)
    • Hardware (HW)
    • DeliveryGroupUtilization (DGU)
    • AddDateTime (ADT)

    The help text has been updated.

    If DeliveryGroupUtilization is used, the script verifies Excel is installed.  If Excel is not installed, the script aborts. If Excel is installed, the script makes sure Excel is not currently running in the user’s session.


    This new option uses the Get-BrokerDesktopUsage cmdlet. The help text for the cmdlet says desktop usage data is deleted after 7 days but my lab contains almost 60 days of data.

    Sample charts from my lab.





    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/

    Thanks and enjoy


    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

    4 Responses to “Documenting Citrix XenDesktop 5.x with Microsoft PowerShell V1.1”

    1. Yvan Scigala Says:

      Thanks Carl, you know your script by heart !

      Although Word and Excel 2013 are both installed on the workstation I launch the script from, I can’t manage to get the Excel Charts within the Word document, whereas the verbose output doesn’t reveal any issue

      VERBOSE: 12/24/2015 10:57:31: Retrieving Assignments
      VERBOSE: 12/24/2015 10:57:32: Adding row for Assignment W7SUPPAS400
      VERBOSE: 12/24/2015 10:57:34: Retrieve Catalogs for Desktop Group W7SUPPAS400
      VERBOSE: 12/24/2015 10:57:35: Ouput Machine W7SUPPAS400P01
      VERBOSE: 12/24/2015 10:57:48: Creating Assigments Utilization report
      VERBOSE: 12/24/2015 10:57:48: Processing Assigment Utilization for W7SUPPAS400
      VERBOSE: 12/24/2015 10:57:49: Initializing utilization chart for W7SUPPAS400
      VERBOSE: 12/24/2015 10:57:49: Getting utilization data for W7SUPPAS400
      VERBOSE: 12/24/2015 10:57:50: Opening Excel with temp file C:\XD5Script\emtempgraph_20151224_105749.csv
      VERBOSE: 12/24/2015 10:57:50: Creating chart for W7SUPPAS400
      VERBOSE: 12/24/2015 10:57:50: Closing excel for W7SUPPAS400
      VERBOSE: 12/24/2015 10:57:50: Deleting temp files C:\XD5Script\emtempgraph_20151224_105749.csv

      One “last” thing : How can I make the script skip the portion where it collects and store the individual machine assignment details ? For a 300 machines pooled-random DG, having this level of details is not necessary worth it, not to mention the time it takes to achieve it 😉

      Kind regards



      • Carl Webster Says:

        I emailed Eduardo who gave me the code for the Excel chart routine. I asked him if he has an answer for you.

        If you use either the -MachineCatalogs (-MC) or the -DeliveryGroups (-DG) parameters, you will get all the machine/desktop details. If you do not want the details, do not use those parameters.



    2. Yvan Scigala Says:

      Hi Carl,

      Great job as ever !

      I just had a couple of questions :

      – is there an easy way to modify the script in order to limit the -dg and -dgu collect to a particular Desktop Group ?(I’m still with XD5.6). I would like to get evidences that a DG has been oversized. Of course, instead of modifying your masterpiece, if you could add this option in the next release, that’ll be much more cool 😉

      – in the readme file coming with the script, would it be possible to add a small section regarding firewall ? In other words, what are the necessary ports that have to be open between the machine running and the script and the different servers implicated in the XD infrastructure ?

      Kind regards



      • Carl Webster Says:

        Change line 5303 from:

        $Assignments = Get-BrokerDesktopGroup @XDParams2 -SortBy Name


        $Assignments = Get-BrokerDesktopGroup @XDParams2 -Name “TheDGYouWant” -SortBy Name

        I have never had firewall issues with either the XD5.x or XD7.x scripts running using the -AdminAddress parameter.




    Leave a Reply