{"id":22985,"library":"winrmcp","title":"winrmcp","description":"A Python package to execute commands on remote Windows machines and copy files to the remote machine using WinRM. Current version 0.0.3, requires Python >=3.6. Low release cadence, last updated in 2017.","status":"maintenance","version":"0.0.3","language":"python","source_language":"en","source_url":"https://github.com/mkroutikov/winrmcp","tags":["winrm","windows","remote","file-copy"],"install":[{"cmd":"pip install winrmcp","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Core dependency for WinRM protocol implementation","package":"pywinrm","optional":false}],"imports":[{"note":"The class is named winrmcp (lowercase) within the winrmcp module.","wrong":"from winrmcp import WinRMCP","symbol":"WinRMCP","correct":"from winrmcp import winrmcp"}],"quickstart":{"code":"from winrmcp import winrmcp\n\n# Connect to remote Windows host\nclient = winrmcp(\n    hostname='192.168.1.100',\n    username='Administrator',\n    password='password',\n    transport='basic',\n    server_cert_validation='ignore'\n)\n\n# Run a command\nresult = client.run_cmd('ipconfig', ['/all'])\nprint(result.std_out, result.std_err, result.status_code)\n\n# Copy file to remote\nclient.copy('local_file.txt', 'C:\\\\Remote\\\\path\\\\file.txt')\n\n# Copy file from remote\nclient.copy('C:\\\\Remote\\\\file.txt', 'local_copy.txt', direction='get')","lang":"python","description":"Basic usage: create a client, run commands, and copy files."},"warnings":[{"fix":"Use `from winrmcp import winrmcp`.","message":"Incorrect import: the main class is `winrmcp` (lowercase), not `WinRMCP`. Importing `WinRMCP` will raise AttributeError.","severity":"breaking","affected_versions":"all"},{"fix":"Explicitly specify direction when copying from remote.","message":"The `copy()` method's `direction` parameter defaults to 'put'. Use `direction='get'` to copy files from remote to local.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure pywinrm and all its extras are installed (e.g., `pip install pywinrm[all]`).","message":"The library requires pywinrm and its dependencies. On non-Windows systems, you may need to install additional packages for Kerberos or NTLM authentication.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Change import to `from winrmcp import winrmcp`.","cause":"Attempting to import WinRMCP (capitalized) instead of winrmcp (lowercase).","error":"AttributeError: module 'winrmcp' has no attribute 'WinRMCP'"},{"fix":"Ensure correct credentials, use transport='basic' with server_cert_validation='ignore', or switch to 'kerberos'/'ntlm' if configured.","cause":"Incorrect username/password or authentication method not supported (e.g., 'basic' requires HTTPS and server cert validation handling).","error":"winrm.exceptions.InvalidCredentialsError: Authentication failed"},{"fix":"Verify network connectivity, check WinRM service is running on target, and ensure firewall allows the port.","cause":"Host unreachable, firewall blocking WinRM ports (5985 HTTP, 5986 HTTPS), or WinRM service not enabled.","error":"ConnectionError: Could not connect to the remote host"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}