Re: Launch an executable as a user from an administrative account




"Stefan Kuhr" <kustt110@xxxxxx> wrote in message
news:uYkqxzntIHA.4772@xxxxxxxxxxxxxxxxxxxxxxx

One of the problems you will face is clearly identifying a process
of the user (as there are potentially many interactively logged on users)

You can determine which of the logged in users is currently the most active
user. Look at WTSEnumerateSessions(), WTSGetActiveConsoleSessionId(),
WTSQuerySessionInformation() and WTSQueryUserToken(). In fact, I image
WTSQueryUserToken() would return the type of token you are looking for. But
if you want to extract a token from a process, then enumerate the running
processes via PSAPI until you find a suitable one, and then use
OpenProcess() and OpenProcessToken().


Gambit


.



Relevant Pages

  • Re: Launch an executable as a user from an administrative account
    ... WTSQuerySessionInformation() and WTSQueryUserToken. ... processes via PSAPI until you find a suitable one, ... OpenProcess() and OpenProcessToken. ... The method you describe looks close to what the script given in the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Launch an executable as a user from an administrative account
    ... Remy Lebeau wrote: ... Look at WTSEnumerateSessions, WTSGetActiveConsoleSessionId, WTSQuerySessionInformation() and WTSQueryUserToken. ... But if you want to extract a token from a process, then enumerate the running processes via PSAPI until you find a suitable one, and then use OpenProcessand OpenProcessToken. ...
    (microsoft.public.win32.programmer.kernel)

Loading