Yo, I’ve used paramiko for SSH on Linux, but yeah, Windows is a whole different beast. If you’re set on using SSH, you can enable OpenSSH on Windows (it’s built-in now, no need for extra software).
But honestly, for execute command on remote windows using python, I’d recommend pywinrm. It’s designed for Windows and works well once you get past the initial setup.
One thing to note: make sure your remote machine has PowerShell remoting enabled. It’s a must for pywinrm to work.
Here’s a quick example:
```python
import winrm
s = winrm.Session('remote-machine', auth=('user', 'pass'))
r = s.run_ps('Get-Process')
print(r.status_code, r.std_out)
```
Hope that helps!
But honestly, for execute command on remote windows using python, I’d recommend pywinrm. It’s designed for Windows and works well once you get past the initial setup.
One thing to note: make sure your remote machine has PowerShell remoting enabled. It’s a must for pywinrm to work.
Here’s a quick example:
```python
import winrm
s = winrm.Session('remote-machine', auth=('user', 'pass'))
r = s.run_ps('Get-Process')
print(r.status_code, r.std_out)
```
Hope that helps!
