--- id: pypsrp version: "0.9.1" license: MIT license_treatment: permissive maintenance: active --- # pypsrp — PowerShell Remoting Protocol and WinRM for Python License: permissive · Maintenance: active · Downloads: 4.4M/mo ## What it is and what it does pypsrp is a Python client library for the PowerShell Remoting Protocol (PSRP) and Windows Remote Management (WinRM) service. It enables you to execute commands, run PowerShell scripts, and transfer files to and from remote Windows hosts from any machine running Python. The library provides multiple API layers: a simple client API for common tasks (command execution, file copy), a WSMan interface for low-level protocol operations, a Windows Remote Shell (WinRS) layer for cmd execution, and a PSRP layer for creating remote runspace pools and pipelines. The package supports multiple authentication methods including Basic, Certificate, NTLM, Negotiate/Kerberos, and CredSSP (the latter two requiring optional dependencies). It handles TLS encryption and message-level encryption, with configurable timeouts, proxies, and locale settings. The library is designed around three main components: Transport (raw message handling), Shell (protocol details), and Process (execution within a shell). It currently supports only WSMan over HTTP/HTTPS but is architected to support SSH in the future. Use it for: - Automate Windows server administration tasks from a Linux or macOS control machine without installing Windows-specific tools. - Execute PowerShell scripts remotely to deploy applications, configure services, or gather system information from Windows hosts. - Transfer files between a local machine and remote Windows servers as part of deployment or backup workflows. - Build cross-platform infrastructure-as-code tools that manage both Unix and Windows environments from a single Python codebase. - Create interactive remote runspace pools with multiple PowerShell pipelines for complex, asynchronous Windows automation scenarios. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Execute commands, scripts, and file operations on remote Windows hosts via PowerShell Remoting Protocol (PSRP) and Windows Remote Management (WinRM) from Python. Yes. Active maintenance, low install friction, permissive MIT license, and no known vulnerabilities make this a solid choice for Windows remote automation. Install it if you need to execute commands or manage files on Windows hosts from Python. Verify that your target Windows environment has WinRM enabled and that you have the necessary authentication credentials or certificates. ## Install pip install pypsrp uv add pypsrp poetry add pypsrp ## Installing pypsrp Before you install: Low install friction with a pure-Python wheel distribution. Active maintenance with recent commits and a stable release cycle. Requires cryptography, pyspnego, and requests as runtime dependencies, all widely maintained. License in practice: MIT license permits commercial and private use with minimal restrictions, making it suitable for most deployment scenarios. Quickstart: pip install pypsrp from pypsrp.client import Client client = Client('remote-host', username='user', password='pass') stdout, stderr, rc = client.execute_cmd('dir') print(stdout) Requires CPython 3.10 or later. Target Windows host must have WinRM service enabled and accessible over HTTP/HTTPS (default ports 5985/5986). Optional: system Kerberos libraries for Kerberos auth, or requests-credssp for CredSSP auth. Verify before relying: - Whether the library supports SSH transport as mentioned in the description excerpt as a future goal - Performance characteristics and scalability limits for concurrent remote operations - Compatibility with non-standard WinRM configurations or hardened Windows environments ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 4.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags windows remote execution python, powershell remoting protocol client, winrm python library, remote command execution windows, psrp python client, windows host automation, remote powershell scripts, windows-automation, remote-execution, system-administration [View on SkillFed](https://skillfed.io/packages/pypsrp) · [View on PyPI](https://pypi.org/project/pypsrp/)