ptwinrm
A Python, prompt_toolkit and pywinrm based WinRM console:
Installation
$ pip install ptwinrm
Requirements
Python >= 2.6
docopt
pywinrm
prompt_toolkit
Usage
Before connecting to the windows machine, make sure the winrm service is running and the firewall is opened for winrm connections. On my windows machine I had to do the following on the windows command line:
# make firewall respect our wishes
C:\>netsh advfirewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow
C:\>netsh advfirewall add rule name="WinRM-HTTPS" dir=in localport=5986 protocol=TCP action=allow
# configure winrm
C:\>winrm quickconfig
# Allow non encrypted (for pywinrm)
C:\>winrm set winrm/config/servive '@{AllowUnencrypted="true"}'
Then you can try to connect from another machine (linux, OSX, windows):
$ ptwinrm --user="acme\roadrunner" --run="ver" acme-rr.com
password: ********
Microsoft Windows [Version 6.1.7601]
$ ptwinrm --user="acme\roadrunner" acme-rr.com
password: ********
C:\Users\roadrunner>dir
Volume in drive C is System
Volume Serial Number is 8C20-216F
Directory of C:\Users\roadrunner
20/04/2017 09:29 <DIR> .
20/04/2017 09:29 <DIR> ..
05/07/2017 10:58 <DIR> Contacts
05/07/2017 10:58 <DIR> Desktop
03/05/2016 11:10 <DIR> Documents
06/07/2017 11:04 <DIR> Downloads
05/07/2017 10:58 <DIR> Favorites
05/07/2017 10:58 <DIR> Links
28/06/2017 08:18 <DIR> Mails
05/07/2017 10:58 <DIR> Music
05/07/2017 10:58 <DIR> Pictures
05/07/2017 10:58 <DIR> Saved Games
05/07/2017 10:58 <DIR> Searches
06/03/2013 15:09 <DIR> Tracing
05/07/2017 10:58 <DIR> Videos
C:\Users\roadrunner> ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : ACME-RR
Primary Dns Suffix . . . . . . . : acme.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : acme.com
Ethernet adapter Local Area Connection 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) Gigabit CT Desktop Adapter
Physical Address. . . . . . . . . : 55-44-33-22-11-00
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : acme.com
Description . . . . . . . . . . . : Acme(R) Gigabit Network Connection
Physical Address. . . . . . . . . : 00-11-22-33-44-55
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 199.199.1.172(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.254.0
Lease Obtained. . . . . . . . . . : quarta-feira 5 julho 2017 10:41:49
Lease Expires . . . . . . . . . . : quarta-feira 3 janeiro 2018 22:42:05
Default Gateway . . . . . . . . . : 199.199.1.1
DHCP Server . . . . . . . . . . . : 198.198.60.11
DNS Servers . . . . . . . . . . . : 198.198.208.9
198.198.209.9
NetBIOS over Tcpip. . . . . . . . : Enabled
Tunnel adapter isatap.acme.com:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : acme.com
Description . . . . . . . . . . . : Microsoft ISATAP Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter Local Area Connection* 11:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
C:\Users\roadrunner>
That’s all folks!
Metadata
Release files for ptwinrm 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ptwinrm-0.1.1.tar.gz | 5.1 kB | Without provenance | Details for ptwinrm-0.1.1.tar.gz |
Release files / ptwinrm-0.1.1.tar.gz
| Download URL | ptwinrm-0.1.1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f92de7c7d54cb0c974fd08bd08915c9f652a60fc164b09c7408e9fe571fcd230
|
|
BLAKE2b-256 checksum How to use checksums |
e8b40904952456a15a0797e7490634969f8d605354825efcf30f2f0d5c1f6c18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ptwinrm 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.