Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

First I want to excuse myself if I'm using incorrect words, I'm not a sysadmin. So, from the Administrator's account I want to run a program as another user. I tried "runas" program. It's working quite well but I want, if there's a RDP session using the account as which I'm running the application, the application to appear at the screen visible by the RDP session. I hope that I was clear... Thank you in advance!

share|improve this question
    
I'm not clear. You want to log in locally and remotely simultaneously with one account, and launch an app (via runas) on the local account and have it show up on the remote desktop? –  Shinrai Sep 12 '12 at 14:27
    
(Also I have to ask...if you're not a sysadmin why are you using a server OS?) –  Shinrai Sep 12 '12 at 14:29
    
I want to be logged into the Administrator account locally, in for example Test account logged via RDP. From the Administrator account to run program as Test and I want the program to be shown in the remote session (in the RDP). –  ovvn3r Sep 12 '12 at 14:29
    
Because I'm a programmer and I'm creating server for Windows 2008. –  ovvn3r Sep 12 '12 at 14:30
    
@own3r - Thank you for the explanation, that's much more clear. (I don't know of any way to do this myself). –  Shinrai Sep 12 '12 at 14:47

1 Answer 1

I suppose you are looking for remote execution. PsExec from SysInternals package implements this. It uses this CreateProcessAsUser function.

Basically what you need is to run something like this:

PsExec.exe \\$Hostname -d -s -u $UserName -p $Password $PathToApp [$Arguments]

where

  • $Hostname - name of your server
  • $UserName - user name of user on which session you want application to appear
  • $Password - his password
  • -d stands for "don't wait for exit" - useful for interactive applications with GUI
  • -s stands for "run application as specified user"
  • $PathToApp - application you want to run in user's session
  • [$Arguments] - command line arguments for application; (brackets means it is an optional parameter)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.