Sunday, October 11, 2009

How to count active users on a Citrix farm and display on a web page.

Get grep.exe and wc.exe for windows at unxutils.sourceforge.net. Create two batch files as below and setup a scheduled task for count.bat.

list.bat
quser /server:citrixa
quser /server:citrixb
quser /server:citrixc
(add more servers)
count.bat
list.bat | grep Active | wc -l > temp
copy a+temp+b /b count.html
copy count.html /b c:\inetpub\www

The files a and b are just some simple html. I now have a simple banner like below that is updated every five minutes.

Citrix Active 34

No comments: