Wisdom-Fu: E-mail Alert when your TS logins are disabled


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:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

If the value is 1, then we’ll set our Wisdom parameter LoginsDisabled to 1, otherwise, it is 0.


Send E-mail

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:


Building block available here.  You can also follow more discussion at the Res Software User Group forums.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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