Reputation: 1445
I have windows 2003 server and want to switch users programatically using c#. I have list of all active user so how can I switch the user ?
I need to capture the screen of all users which are logon currently.
Thanks Laxmilal
Upvotes: 2
Views: 5300
Reputation: 7630
You can execute actions with impersonations(with a specific username and password) in ASP .Net.
If it's a windows application you just start a process with different username described in here. http://msdn.microsoft.com/en-us/library/ed04yy3t.aspx
Cheers, Stefan
Upvotes: 1
Reputation: 498952
It is not entirely clear what you want to achieve.
There are several ways to have a program run as a different user than the logged in one (or have the program execute another process with different credentials):
runas
, supplying the credentials for the other userProcess.Start
with ProcessStartInfo
. This lets you provide the credentials under which the process should runYou can't change the credentials of an already running process.
Can you explain exactly what you are trying to achieve? Perhaps there are other ways to achieve what you want.
Upvotes: 2
Reputation: 11903
You mean like if you lock the screen and log on with someone else? That is totally impossible. You know the login screen says you need to press ctrl-alt-del, it is designed so that noone can mess with that. You can impersonate users however, like with the runas command, but you need to know their passwords for that.
Upvotes: 0