Created
February 15, 2017 06:14
-
-
Save devilrancy/dd56077afd81ab312726264e16f39c77 to your computer and use it in GitHub Desktop.
using python pywinrm to connect with windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import winrm | |
ps_script = open('scripts/mem.ps1','r').read() | |
s = winrm.Session('10.2.0.42', auth=('the_username', 'the_password')) | |
r = s.run_ps(ps_script) | |
print r.status_code | |
print r.std_out | |
print r.std_err |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment