XenApp server maintenance is a necessary part of managing a Citrix farm (unless you are using Provisioning Services?). We use Wisdom (which I will detail in a later post) to perform an elaborate, reoccurring maintenance reboot job on our servers. Part of the maintenance job is to disable Terminal Server logins when the job starts and enable them when the job completes. Naturally, Murphy’s Law is in effect all the time when it comes to Citrix servers, so the maintenance job will not complete on a couple of servers and they will have their logins disabled when users start to login. For this post, I’m going to detail a simple Wisdom module that you can schedule to run ‘in the morning’ that will send you an e-mail alert for any servers that have their logins disabled.
Wisdom Module Overview
The module consists of 2 actions:
With these module parameters:
- SERVERNAME will be set to the %COMPUTERNAME% environment variable of the server the module is run against.
- SecurityContext is used for the E-mail task
- LoginsDisabled is a conditional parameter that we use to determine whether to send an e-mail or not.
Wisdom Module Detail
Query Registry Settings
The first task simply examines the WinStationsDisabled value for the following registry key:
If the value is 1, then we’ll set our Wisdom parameter LoginsDisabled to 1, otherwise, it is 0.
The second task runs if the LoginsDisabled parameter is equal to 1, otherwise skip this task.
Here are the e-mail settings so you can see how the SERVERNAME parameter is used: