I am new to Python and I am trying to make a script that connects to a remote windows machine and execute commands there and test ports connectivity.
Here is the cod
Many answers already, but one more option
PyPSExec https://pypi.org/project/pypsexec/
It's a python clone of the famous psexec. Works without any installation on the remote windows machine.