Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pywinrm Build Status Coverage Status

pywinrm is a Python client for Windows Remote Management (WinRM). This allows you to invoke commands on target Windows machines from any machine that can run Python.

WinRM allows you to call native objects in Windows. This includes, but is not limited to, running batch scripts, powershell scripts and fetching WMI variables. For more information on WinRM, please visit Microsoft’s WinRM site.

Requirements

  • Linux, Mac OS X or Windows

  • CPython 2.6, 2.7, 3.2, 3.3 or PyPy 1.9

  • python-kerberos is optional

Installation

To install pywinrm, simply

$ pip install http://github.com/diyan/pywinrm/archive/master.zip

In order to use Kerberos authentication you need optional dependency

$ sudo apt-get install python-dev libkrb5-dev
$ pip install kerberos

Example Usage

Standard API example (in progress)

import winrm

s = winrm.Session('windows-host', auth=('john.smith', 'secret'))
r = s.run_cmd('ipconfig', ['/all'])
>>> r.status_code
0
>>> r.std_out
Windows IP Configuration

   Host Name . . . . . . . . . . . . : WINDOWS-HOST
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
...
>>> r.std_err

Low-level API example

from winrm.protocol import Protocol

p = Protocol(
    endpoint='http://windows-host:5985/wsman',
    transport='plaintext',
    username='john.smith',
    password='secret')
shell_id = p.open_shell()
command_id = p.run_command(shell_id, 'ipconfig', ['/all'])
std_out, std_err, status_code = p.get_command_output(shell_id, command_id)
p.cleanup_command(shell_id, command_id)
p.close_shell(shell_id)

Contribute

Want to help - send a pull request. I will accept good pull requests for sure.

Metadata

Release files for pywinrm 0.0.2dev

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywinrm 0.0.2dev
File Size Uploaded Provenance Actions
pywinrm-0.0.2dev.tar.gz 13.2 kB Without provenance Details for pywinrm-0.0.2dev.tar.gz

Release files / pywinrm-0.0.2dev.tar.gz

Download URL pywinrm-0.0.2dev.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
37aeb900d805de2650882a44f5b63d1b8ae6b7742c09cdb90e954a6837546ede
BLAKE2b-256 checksum
How to use checksums
d9fe67f00442d3fcb1ae578973c8eeb2f2a31ddae7a858f876f9566faa6c6cf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pywinrm 0.0.2dev

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page