How can I execute command on remote Windows using Python? Best methods and examples?

14 Replies, 2141 Views

Thanks so much for all the suggestions, everyone! I ended up trying pywinrm, and it worked like a charm after I got WinRM configured properly. The Microsoft guide you linked was super helpful for that.

I did run into a small hiccup with authentication at first, but adding the remote machine to the TrustedHosts list fixed it.

I’m curious though—has anyone tried using pypsrp? I saw it mentioned and it looks interesting, especially since it supports both cmd and PowerShell. Any pros/cons compared to pywinrm?

Thanks again for all the help! You guys saved me a ton of time.

Messages In This Thread



Users browsing this thread: 1 Guest(s)