views:

279

answers:

2

I would like to programmatically login another windows user in interactive mode. I've created new Windows user account and would like to switch system to that account without of user interaction.

Could you please point me to some API commands or MSDN pages? Thanks

+1  A: 

looks like WTSConnectSession is the right direction

Alexander Kosenkov
+1  A: 

If you're not talking about a Terminal Server session, you'll want LogonUser() if you're logging in as that user, or ImpersonateLoggedOnUser() if you're wanting to do something as an already-logged in user. Both can be found in Advapi32.lib.

Ken White