Enumerate logins on a citrix/terminal server using vb.net

Hey all,

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There is a tool already available which might be helful for you --> http://support.citrix.com/article/ctx121653 

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
theoaksAuthor Commented:
This defintely does what I need to do (ie list users and their processes), but it is unfortunately not quite what i need.

This is all part of a larger program I'm writing so I need to be able to do it programatically using VB.net. (and the source for that app doesn't seem to be available)

It does mean at least that what I want to do is possible wich is reassuring! ;)
you can try CDN Citrix website --> http://community.citrix.com/cdn

it usually have lots of scripts and good pointers to interact with different Citrix components.
theoaksAuthor Commented:
Thanks guys.  I've had a bit of a play with MFCOM for citrix and it looks like it gives me some pretty good  functionality to enumerate all kinds of citrix stuff.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server OS

From novice to tech pro — start learning today.