If you’re looking to execute command on remote windows using python, I’d recommend checking out `pypsrp`. It’s another library that works over WinRM and is pretty straightforward to use.
One advantage of pypsrp is that it supports both PowerShell and cmd commands, so you’ve got flexibility.
Here’s a quick example:
```python
from pypsrp.powershell import RunspacePool
with RunspacePool('remote-pc', username='user', password='pass') as pool:
ps = pool.run_script('Get-Process')
print(ps.output)
```
Also, if you’re dealing with firewalls, make sure port 5985 (HTTP) or 5986 (HTTPS) is open.
Good luck with your project!
One advantage of pypsrp is that it supports both PowerShell and cmd commands, so you’ve got flexibility.
Here’s a quick example:
```python
from pypsrp.powershell import RunspacePool
with RunspacePool('remote-pc', username='user', password='pass') as pool:
ps = pool.run_script('Get-Process')
print(ps.output)
```
Also, if you’re dealing with firewalls, make sure port 5985 (HTTP) or 5986 (HTTPS) is open.
Good luck with your project!
