how do you pipe the password with Runas?

taktsoitaktsoi Member Posts: 224
i m trying to find a way to pipe the password with runas for automatic script. I google and can't find anything except third party softwares, which i dont' prefer.

does anybody know how?

thanks
mean people SUCK !!! BACK OFF !!!
The Next Stop is, MCSE 2003 and CCNA.
Bachelors of Technology in 1 More Year.

-Working on CCENT. Thank you my love <3

Comments

  • sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    You can't. Microsoft locked it down to prevent people from doing that.

    http://www.microsoft.com/technet/security/guidance/serversecurity/administratoraccounts/aapgch03.mspx
    Note: It is not possible to input the password as a command-line parameter to runas.exe, because it would not be secure to do so.

    Many other references say the same thing, and I have seen a million people looking for a way to make the runas.exe accept an automated way to input the password. The answer always comes back the same - you can't. icon_sad.gif
    All things are possible, only believe.
  • sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    On another note, however, you can pass alternate credentials using vbscript, as long as it is run against a remote computer and not the local computer:
    strComputer = "server1"
    strNamespace = "root\cimv2"
    strUser = "administrator"
    strPassword = "password123"
    
    Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = objwbemLocator.ConnectServer _
        (strComputer, strNamespace, strUser, strPassword)
    
    All things are possible, only believe.
  • royalroyal Member Posts: 3,352 ■■■■□□□□□□
    You can use TQrunas. It is essentially runas which allows you to also supply a password. You can find this utility here.
    “For success, attitude is equally as important as ability.” - Harry F. Banks
  • WorktruckWorktruck Member Posts: 15 ■□□□□□□□□□
    I've used CPAU a few times to runas in scripting. If you do use it I'd make user to use the little encryption feature, because if not the user name and password of the account will show up in plain text when the script runs, and you really don't want that.

    http://www.joeware.net/freetools/tools/cpau/index.htm
Sign In or Register to comment.