GetProcesses() but only current user? (on Terminal server)

  • Thread starter Thread starter Jamesb
  • Start date Start date
J

Jamesb

I have my app use GetProcesses() to check if a certain app is running, and
warn the user if not.
On a terminal server though, this seems to return all running processes, so
if a user in another session is running said process, my user won't get
warned.

Unfortunately the user property seems to be null though, so I can't compare
on that.

Any bright ideas?

James.
 
Have you tried to explicity set the IIDentity when a "session user" logs in?


http://msdn.microsoft.com/en-us/library/ms954586.aspx



GenericIdentity identity = new GenericIdentity("Mary");
Thread.CurrentPrincipal = new GenericPrincipal(identity, new string[]
{"CanApproveClaims", "User"});

That is some code from the article that I modified slightly. The key is
setting it....when a "session user" logs in. Then testing to see if you can
tell the users apart.
I no NO idea if it'll work.

You can create your own IIdentity and even your own IPrincipal.


I have ZERO experience with terminal server, but there's a hint for you.
 
Back
Top