Unable to supply password to runas from commandline

后端 未结 1 799
深忆病人
深忆病人 2020-12-22 05:19

I am unable to supply password to runas from commandline

I have tried the following

cmd /C echo my_admin_password | runas /user:DOMAIN\\my_admin_logi         


        
相关标签:
1条回答
  • 2020-12-22 05:55

    Take a look at this link: runas utility

    It's a runas free utility that have the follwing features:

    1. It accepts password as a command line parameter so that it can be used in batch files.

    2. It can bind started process to the interactive user Desktop so it can be used to start interactive processes from various services such as 24x7 Scheduler, 24x7 Event Server and other.

    3. Note: Professional version of RunAs also supports encryption of the entire command line, which administrators can use to give regular users access to certain programs requiring admin-level privileges. Users don't need to know the administrator's password and cannot use it to run anything else… simple, yet very efficient solution for this common problem.

    Also you can try pass the password as input for the process using subprocess.Popen.communicate or even subprocess.Popen.stdin.write.

    Other interesting links:

    How to pass a password to a process?

    Command-line runas with password

    PsExec

    0 讨论(0)
提交回复
热议问题