How to limit concurrent application instances in a Remote Desktop Services Environment?

Hello Experts!

I am running a Remote Desktop Services farm environment on Windows Server 2008 R2 Standard servers. For licensing purposes, I wish to limit the number of times a specific application can be run concurrently across the farm. That is, I have 'x' licenses for application 'y', and need to make sure that no more than 'x' users are running the application at any one time inside their remote desktop sessions.

I can't find any documentation as to how I might be able to do this using Remote Desktop Services, or a third party tool. I do know that this is somewhat possible using Citrix products.

Any advice as to how I might achieve this would be appreciated.

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.

Cláudio RodriguesFounder and CEOCommented:
This is possible with third party tools like AppSense.
If you want to do on your own you can of course script it.
What you need to know is how many TSs you have and their names/IP.
On your script you then run a QUERY PROCESS command to get the list of processes running on each server.
After parsing the output all you need to do is to find if such process is on the list and count how many times. If it exceeds your threshold you simply do not launch it.
The key is of course to always use your script to launch the application so ideally the script would take one parameter (the process you are looking for) and if it does not exceed the limit, it launches it. If it exceeds it throws a message to the user.
A good start is shown here (in VBScript instead of using QUERY PROCESS).

Cláudio Rodrigues
Citrix CTP

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
nickfridayAuthor Commented:
Thankyou tsmvp that has given me some ideas.
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.