Einzelnen Beitrag anzeigen

Benutzerbild von Remko
Remko

Registriert seit: 10. Okt 2006
Ort: 's-Hertogenbosch, Die Niederlande
222 Beiträge
 
RAD-Studio 2010 Arc
 
#5

Re: anderen Benutzer abmelden

  Alt 20. Feb 2008, 13:14
I think there are several options:

1) Grab the token from the user you want to logoff, then user createprocessasuser. This process uses ExitWindows(Ex) to logoff.
2) Providing Terminal Server (eg Windows XP Pro) is running you can use the Terminal Server API to logoff a specific session, which would probably be the console session (use WTSGetActiveConsoleSessionId to obtain sessionid).
3) Maybe WTS_WSD_LOGOFF as Chris suggested is a good solution for you (according to docs you cannot remote logon after, but im not sure this is true for workstation also).

If a restart is ok you can offcourse use Terminal Server Shutdown function.
  Mit Zitat antworten Zitat