The problem

At the start of each shift, the operations team needed to check desktop capacity and review supporting infrastructure. Repeating those checks manually created a routine task that could be brought into a single report.

I identified this repetitive work and wrote a PowerShell reporting solution.

Desktop capacity across two Citrix sites

The script queries two Citrix sites and selects Delivery Groups tagged as active, excluding groups matching the maintenance naming pattern. Results are grouped by site and Delivery Group.

For persistent desktops, it counts machines that are not assigned to a user. For the selected non-persistent desktop groups, it counts machines with no sessions.

These counts provide a view of spare capacity for further investigation.

VMware KMS status

The script connects to two vCenter instances using a read-only service account and retrieves Key Management Server (KMS) status. This refers to VMware encryption key management.

If a vCenter connection or KMS query fails, the failure is recorded in the report. Connections are disconnected after each check.

Reporting and scheduling

Desktop capacity and KMS results are formatted into HTML tables, saved as a timestamped report and emailed to the operations team.

Windows Task Scheduler runs the script three times a day, aligned with the three shifts. Each run provides a fresh report as a starting point for shift checks.

The outcome

The solution brings several routine checks into one consistent report, reducing repetitive manual collection and helping the team identify areas requiring further investigation.

The report supports operational review.