Reporting script for SBC farms

A lot of RDS and XenApp farm (SBC in general) are on a reboot schedule. Meaning they reboot regularly, mostly daily or weekly. This is done to ensure stability of the servers and to have a maintenance window in which we can install or upgrade software. Specifically we use Automation Machine Maintenance for this. AM Maintenance is used to provide high availability of the SBC farm. Maintenance accomplishes this by rebooting the server in 2 separate groups.

Rebooting and deploying software automatically without having to perform any actions outside of office hours is a nice feature. It does impose some risks. For multiple reasons the servers might not be up and running properly after the reboot and/or after deploying new or updated software. You could do a manual check each time the farm is rebooted but that sounds like a lot work and is very repetitive. To me, that sounded like something that can be automated. Ideally you would like a report each morning with a list of server and metrics.

With this in mind i wrote a Powershell script which does just that. It creates a list of server, retrieves a bunch of metrics and bundles them in a nice report using HTML. That’s all nice but you’d like to have it available for reading somewhere. So i also made it save to a location (locally or on a share) and it e-mails the report to one or more recipients.

The script currently has the following features (you can enable and disable them to suit your needs):

Feature
Requirements
Notes
Server NameXenApp PoSh SDK or Automation Machine 2012You can choose to use XenApp or Automation Machine to retrieve the servernames
Collection NameXenApp PoSh SDK or Automation Machine 2012You can choose to use XenApp or Automation Machine the retrieve the collection
Server StatusICMP trafficUses test-connection (ping)
Logon StatusWMI
Server IPICMP traffic
Server ListenerXenApp PoSh SDK
Last Boot TimeWMI
Install TimeWMI
CitrixXenApp PoSh SDKEnables or disables importing the Citrix XenApp PoSh SDK
Data CollectorsXenApp PoSh SDK
Load EvaluatorsXenApp PoSh SDK
Session CountXenApp PoSh SDK
Startup ErrorAutomation Machine 2012
Cycle ErrorAutomation Machine 2012
S4MaticAutomation Machine 2012
AmTasksAutomation Machine 2012

To give you an idea of what this will look like:

Reporting script output

You can download the script here. Or if you don’t like downloading the reporting script directly. You can check out the code below and copy it yourself.