0

I have a requirement to write a script that will launch a new process, as an existing/logged in user, into there specific session, with powershell.

Ive done some research and it seems as though I can use the ’Wtsapi32′ module to get the user session token, duplicate it and launch the process as that user. However, Im not sure how to call the loaded module. Does anyone have an tips/hints on this? ie for ‘WTSQueryUserToken’?

An example of what my logic and research is here My link

  • 1
    You might have to p/invoke to call the Win32 API functions you need. Check this out: http://stackoverflow.com/questions/668389/calling-createprocessasuser-from-c-sharp . Here's an example of p/invoking in Powershell: http://andyarismendi.blogspot.com/2011/10/powershell-set-secureautologon.html – Andy Arismendi Dec 12 '11 at 06:19
  • Thanks for the suggestions Andy, Ill check them out and get back to you! – user1093042 Dec 15 '11 at 04:33

0 Answers0