[Script] Checking the Percentage of Desktops Available in Each XenDesktop Site

When you manage multiple sites you may find that Citrix Director lacks an “at-a-glance” view of the status of multiple sites. This becomes extra apparent in a large pod-based design where multiple sites may exist within the same datacenter or in an active-active datacenter setup. With VDI, it is important to check the total number of VM’s that are available for brokering. If the number is too low, you could be faced with a boot storm (assuming you have powered off virtual machines) if a large number of users log in. Or worse, you may not have available capacity. It is important to catch such incidents before they happen. Therefore, I present to you a script to output a simple HTML formatted table that can be incorporated into existing monitoring dashboards or sites (such as SharePoint).


Figure 1 Sample table output from script

Copy the script above into a text editor and save it as a .ps1 file. From there you can execute it via the command line or run it as a schedule task. For example:

.\CheckDesktopsAvailable.ps1 -SitesToMonitor “site1.contoso.local”,”site2.contoso.local” -OutputPath “C:\temp\report.html” -Interactive

If you are running the script as a scheduled task, omit the -Interactive switch to receive the file only. You can then integrate the output via another method into your monitoring platform of choice.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.