pypsexec
Run commands on a remote Windows host using SMB/RPC
Decision gist · record as of 2026-08-14
Yes, if you need to run commands on remote Windows hosts from Python and can meet the prerequisites (SMB access, admin credentials, appropriate UAC configuration). The low install friction and permissive license make it straightforward to add. However, note that the package has not been updated since 2021; if you require active maintenance or support for the latest Windows or Python versions, verify compatibility first or consider whether an actively maintained alternative exists.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Remote Windows host must have SMB port 445 open, ADMIN$ share enabled with read/write access, and the connecting user must be an administrator or have appropriate token rights (UAC filtering may block non-admin tokens).
- Low install friction with a single runtime dependency (smbprotocol).
- The package is aging—last release was 2021-10-21 and no updates in over three years—but the repository remains active with recent commits and no archived status.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use and modify the code freely as long as you include the license notice.
last release 2021-10-21 (1758 days) · last repo commit 2025-10-17 · 138 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 177,505 downloads/mo, #10,211 on PyPI
Alternatives
Verify before relying
pip install pypsexec
from pypsexec.client import Client
client = Client('remote_host', username='user', password='pass')
client.connect()
stdout, stderr, rc = client.run_executable('cmd.exe', arguments='/c whoami')
client.disconnect()- Whether the package works with modern Windows Server versions beyond those documented in the description.
- Current compatibility with Python 3.10+ given the last release predates those versions.
- Whether smbprotocol's optional Kerberos support is automatically available or requires separate installation.
What it is and what it does
pypsexec is a Python library that executes commands on remote Windows hosts using SMB and RPC protocols, mimicking the behavior of the PsExec tool. It works cross-platform—you can run it from Linux, macOS, or Windows—and does not require PsExec binaries to be installed on the local machine. The library handles the full lifecycle: establishing an SMB connection, copying a PAExec binary to the remote ADMIN$ share, creating a Windows service to run the binary, piping commands and capturing output, and cleaning up afterward.
The package supports running processes as specific users (local, domain, or SYSTEM), interactive sessions, custom process priorities, timeouts, stdin input, and processor affinity. By default it encrypts data in transit using SMB encryption, though older Windows versions (7, Server 2008, Server 2008 R2) do not support this and fall back to XOR scrambling. The main runtime dependency is smbprotocol; Kerberos authentication is optional and requires additional system libraries.
Use it for
- Automate administrative tasks on remote Windows servers from a Python script running on any OS.
- Deploy or execute batch jobs on Windows hosts without installing PsExec or managing separate binaries.
- Run diagnostics or remediation commands on multiple Windows machines as part of a larger orchestration workflow.
- Execute commands under specific user accounts or the SYSTEM account for privilege-level testing or service management.
- Capture stdout and stderr from remote processes for logging or real-time monitoring in a centralized Python application.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to run commands on remote Windows hosts from Python and can meet the prerequisites (SMB access, admin credentials, appropriate UAC configuration).
The low install friction and permissive license make it straightforward to add. However, note that the package has not been updated since 2021; if you require active maintenance or support for the latest Windows or Python versions, verify compatibility first or consider whether an actively maintained alternative exists.
Install
pypsexec on PyPI
Before you install
Low install friction with a single runtime dependency (smbprotocol). The package is aging—last release was 2021-10-21 and no updates in over three years—but the repository remains active with recent commits and no archived status.
Remote Windows host must have SMB port 445 open, ADMIN$ share enabled with read/write access, and the connecting user must be an administrator or have appropriate token rights (UAC filtering may block non-admin tokens).
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use and modify the code freely as long as you include the license notice.
Quickstart
pip install pypsexec
from pypsexec.client import Client
client = Client('remote_host', username='user', password='pass')
client.connect()
stdout, stderr, rc = client.run_executable('cmd.exe', arguments='/c whoami')
client.disconnect()
Verify before relying
- Whether the package works with modern Windows Server versions beyond those documented in the description.
- Current compatibility with Python 3.10+ given the last release predates those versions.
- Whether smbprotocol's optional Kerberos support is automatically available or requires separate installation.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagesmbprotocol |
| Maintenance | Aging 1,758 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 177,505 / month, #10,211 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: pypsexec-0.3.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “remote command execution windows”
- pypsexecRuns commands on remote Windows hosts via SMB/RPC without requiring…
- pypsrpExecute commands, scripts, and file operations on remote Windows…
- pywinrmpywinrm is a Python client for Windows Remote Management (WinRM) that…
Give your agent the search over MCP, or paste the wish link into any chat.
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
psutil retrieves real-time information about running processes and system resources (CPU, memory, disks, network, sensors) across multiple operating systems, enabling system monitoring, process profiling, and resource management.
pyOpenSSL wraps OpenSSL's SSL/TLS functionality for Python, providing high-level connection objects and certificate handling through a Python-friendly interface around OpenSSL's cryptographic operations.
uvloop is a drop-in replacement for Python's built-in asyncio event loop, implemented in Cython and using libuv, that accelerates async I/O operations.
execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.
However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…
PyZMQ provides Python bindings for ZeroMQ (ØMQ), a lightweight messaging library that enables fast, asynchronous communication between distributed processes and applications.
See also elevate · pypsrp · smbprotocol · pywinrm · pysmb · grpcio · winkerberos · requests-credssp · EasyProcess · bash