Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 pywinrm python模块方法示例_Python 2.7 - Fatal编程技术网

Python 2.7 pywinrm python模块方法示例

Python 2.7 pywinrm python模块方法示例,python-2.7,Python 2.7,python windows remort中pywinrm的run_cmd和run_ps方法示例 我想要一个如何执行run_cmd方法的示例 我想要一个如何执行run\u ps方法的示例 应该编写什么来代替windows-host.example.com import winrm ps_script=""" Get-VMMServer -ComputerName "xx.xx.xx.xx" """ s=winrm.Session('xx.xx.xx.xx',auth=('username',

python windows remort中pywinrm的run_cmd和run_ps方法示例 我想要一个如何执行run_cmd方法的示例 我想要一个如何执行run\u ps方法的示例 应该编写什么来代替windows-host.example.com

import winrm

ps_script=""" Get-VMMServer -ComputerName "xx.xx.xx.xx" """

s=winrm.Session('xx.xx.xx.xx',auth=('username','password'))    
r=s.run_ps(ps_script)   
print r.status_code  
print r.std_out
这可能对你有帮助