Enumerate logins on a citrix/terminal server using vb.net
Posted on 2010-04-07
We have a citrix farm with a handfull of windows 2003 servers that provide for a bunch of our sites.
Each site should have one computer on their front desk that logs in as special user that runs a specific program that should be running 24/7.
In part of a program I'm writing I want to be able to query our servers to make sure.
A. The special user is logged in somewhere for each site
B. That special user is running the required program.
I would be 90% happy if I could just confirm A, but following up with B would be great.
There are two ways I have considered attacking this. The first is to query each server via WMI and get a list of running process/users and manipulate the list to check everything is as it should be. If i can get a full list of users/processes I have no problems manipulating that, but my SQL/WQL and WMI knowledge is limiting and I'm not having much luck.
The second way I have considered is to use the Citrix API and query our farm for this information. At the end of the day this is probably the better way as I can just query the whole farm at once rather than each server in turn.
I'm happy to get either of these option working, I've just reached the point were I'm a little lost and need some help to get further.
I'm trying come up with a way using vb.net to enumerate a list of users and if possible associated processes.
The environment we are running is a