• Citrix XenApp/XenDesktop 7.8+ Documentation Script Update Version 2.15

    I am in the process of creating some XenApp/XenDesktop application scripts the community has asked me to create. One is fairly simple, or so I thought.

    The request was simple, for each application, list the Delivery Group that provides that application. For each Delivery Group, list each Machine Catalog that provides machines for the Delivery Group. Since I already have that code in the full documentation script, I thought it wouldn’t take much to get this simple script done. So I created three XenApp 7.17 Machine Catalogs, a Delivery Group with a machine from all three Machine Catalogs, published Calculator and ran my little script. Much to my surprise, only one Machine Catalog was listed. That took me on a journey to find the bug. After a brief email thread with my main PowerShell mentor, MBS, and digging into the help text for Sort-Object and its -Unique switch, I found out I needed to add a name property to the statement. That led me to look at every use of Sort-Object with -Unique in both XenApp/XenDesktop 7.xx documentation scripts. Which meant I had to build additional Machine Catalogs, Delivery Groups, Tags, Applications, and more to test as many scenarios as I could. That led me to find many issues with Text output and a wrong variable used for Excluded Users in the Desktop Entitlement section.

    The fact that getting all the Machine Catalogs that make up a Delivery Group has been broken since the initial V1 script was released three years ago either means no one uses multiple Machine Catalogs per Delivery Group or no one verified the data in the report. Either way, this is now fixed thanks to a community request for another script.

    While I was going through all this, a Citrite on the XenDesktop team reminded me that Get-BrokerDesktop was deprecated and I shouldn’t be using it and I should use Get-BrokerMachine in its place. Fortunately, the deprecated cmdlet was only used four times in each script making it a simple task to replace it.

    For my employer, Choice Solutions, I perform Citrix Health Checks. I always like to include IP address for the various components that make up a Citrix XenApp/XenDesktop environment. To make my job a little easier, I added the IP address for the Citrix License Server and the SQL servers. I know, I am lazy but why do something manually when a script can automate getting the data I need for a report? Most of the fixes in this script update were added to the V1 script in version 1.42.

    #Version 2.15 16-Apr-2018

    • Added Function Get-IPAddress
    • Added in Function OutputDatastores getting the IP address for each SQL server name
    • Added in Function OutputLicensingOverview getting the IP address for the license server
    • Changed from the deprecated Get-BrokerDesktop to Get-BrokerMachine
    • Fixed many alignment issues with Text output
    • In the Desktop Entitlement section, Excluded Users, the wrong variable name was used. Fixed.
    • When building the array of all Machine Catalogs that are used by a Delivery Group,
      • Only the first item in the array was being returned. Adding -Property CatalogName
      • to Sort-Object was needed to get the full unique array returned.
      • Sort-Object -Property CatalogName -Unique

    In making these updates, I found that the SQL datastore information for Always-on Availability Groups (AAGs) is not working. I have not found a solution yet. I also tried to find a way to get the Listener information and IP address(es) but have been unsuccessful. If you are using multi-subnet failover, then each Listener will have two IP addresses. I will keep trying to find a way to retrieve this information for SQL AAGs.

    Figure 1

    Figure 2

    Figure 3

    Figure 3

    You can always find the most current script by going to https://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