Skip to main content

Remote PowerShell over WMI (RPSoWMI)

Project description

Remote PowerShell over WMI (RPSoWMI) enables you to run PowerShell code with support of STDIN, STDOUT, STDERR and return code through Windows Management Instrumentation (WMI) on remote host.

Communication with your PowerShell code is done through 2 named pipes (one for outbound and another for inbound) being created on executor’s machine, that means your access rights must be enough privileged not only for creation of new process on remote machine but also for access to the named pipes on executor’s machine from remote machine.

How to use RPSoWMI:

from rpsowmi import RemotePowerShellOverWmi as RPSoWMI
from wmi import WMI  #

rps = RPSoWMI(WMI())
r = rps.execute("Write-Host 'Hello, world'")
print(r.stdout)  # Just showing 'Hello, world'.

For more details, read pydoc of rpsowmi.RemotePowerShellOverWmi.

Known problems

  • Length of your PowerShell code is limited up to around 2,800 characters because the code is tranfered as a part of command line arguments.

  • Line separators - CR, LF and CRLF are unified to LF (\n) somewhere in communication between RPSoWMI and your PowerShell code.

  • Line separator - LF (\n) may be appended to STDOUT and STDERR even though your PowerShell code doesn’t do it.

Version history

  • v2017.4.11: Initial release.


Build status

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (10.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page