I have a requirement where I need to do some service restarts and iisreset using python on a couple of remote servers. I have managed to write py code for service restarts using WMI but not able to find any module or solution for doing iisreset.
I know how to do an IIS reset using PowerShell remoting but need it specifically for python. One solution I can think of is making a bat file, copying it on a remote server and executing that bat file as admin using psExec or WMI but would prefer if any module is there for handling IIS-related operations.
I found one module(called iis_bridge) but not sure if it allows working on a remote server. Any thoughts/suggestions?
Also suppose we opened WMI connection to a remote server, do we need to close the wmi connection? I looked into a couple of WMI related documents but none had information to close WMI connection. Is it not needed?