From: Gudrun Berger on
Hello,

with TS it's possible to "take over" a different user session using taskmgr.

Can anybody tell me how this is accomplished?

Can I "transfer" an application from a different TS session to "my"
session or send an application to a different session?


How can a app started in a different TS session?

I assume sufficient rights, i.e. at least admin rights.
From: Skywing [MVP] on
Duplicate a primary token of a process on that session and pass to
CreateProcessAsUser. If you are creating the token with your own
credentials, use LsaLogonUser to create a token (and include the logon sid
of the user native to that session - perhaps from retrieved from querying
the token returned by WTSQueryUserToken - so that the new process has access
to WinSta0\Default). Then, use SetTokenInformation(...TokenSessionId..)
(requires SeTcbcPrivilege enabled and assigned) to set the session id in the
token; this ensures that the process will start on the target session and
not session zero. The resultant token can be passed to CreateProcessAsUser.

If you have further questions, I would search the list archives, as there
have been a number of questions about this topic answered recently.

--
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
"Gudrun Berger" <HeMi(a)t-online.de> wrote in message
news:45a39603$0$488$bfcc4b32(a)reader.news.celox.de...
> Hello,
>
> with TS it's possible to "take over" a different user session using
> taskmgr.
>
> Can anybody tell me how this is accomplished?
>
> Can I "transfer" an application from a different TS session to "my"
> session or send an application to a different session?
>
>
> How can a app started in a different TS session?
>
> I assume sufficient rights, i.e. at least admin rights.

From: Remko on
Or you can use the (undocumented) functions from Winsta.dll:
WinStationShadow (shadow another user)
WinStationConnectW (connect to another session)

See for more info jwaWinsta.pas from the Jedi ApiLib:
http://sourceforge.net/projects/jedi-apilib