1

I want to run os level commands using winrm python library , but the command which i am running needs password and other user input parameters . Thus the script is getting stuck once the command is being executed , as it waits for the user input .

Note: In Linux , i have used Paramiko and was successful in running the same command and taking the user input as (stdin.write/stdin.flush)

Please could someone help me with the Windows part .

Note: In Linux , i have used Paramiko and was successful in running the same command and taking the user input as (stdin.write/stdin.flush)

  • If the dupes do not fit your question, please [edit] it and detail whats different in your case. – Patrick Artner Jun 21 '19 at 06:21
  • The OS level command which i am running ask for the input in the next line and thus we cannot pass in the same line. i want to pass Password as input in the next line . In paramiko i am doing stdin.write(abcd) ,passing the password like this in the next line, how can i do the same in windows server – Souvik Banerjee Jun 21 '19 at 06:30
  • You get asked a admin pw because you connect as "normal" user - connect as admin in the first place and you omit the question alltogether. – Patrick Artner Jun 21 '19 at 06:53
  • the command which i am trying to run , do not run as admin, needs to be run as normal sidadm user. Note: Also apart from password as an input it asks for y/n input as the 2nd input. and then finally should be the output. But unable to get till the output as it is stuck in between the 'password' and 'y/n' input. – Souvik Banerjee Jun 21 '19 at 07:20
  • [how-to-run-python-script-with-elevated-privilege-on-windows](https://stackoverflow.com/questions/19672352/how-to-run-python-script-with-elevated-privilege-on-windows) and [how-to-connect-to-remote-machine-via-winrm-in-python-pywinrm-using-domain-acco](https://stackoverflow.com/questions/32324023/how-to-connect-to-remote-machine-via-winrm-in-python-pywinrm-using-domain-acco) did not fit as dupe – Patrick Artner Jun 21 '19 at 09:43
  • any suggestions or advice is much appreciated . Not able to find a solution for the above mentioned problem. The OS level command is kind of an interactive cmd , where it asks for user inputs – Souvik Banerjee Jun 21 '19 at 10:01
  • Or is there are any other package other than winrm , where one can remote login in windows server and run os level commands and also pass user interactive inputs – Souvik Banerjee Jun 21 '19 at 10:07

0 Answers0