WebSocket-for-Python icon indicating copy to clipboard operation
WebSocket-for-Python copied to clipboard

[win Error 10061] No connection could be made because the target machine actively refused it.

Open jeenokia opened this issue 6 years ago • 0 comments

I'm running Windows 2008 virtual machine in my desktop and try running following python code to get process details running in virtual windows server. however it end with connection refuse error message. I'm new to coding and need help in debugging the code. Tested connection using winrm and it worked, however using pypsrp module unable to establish connection with server.

Server IP address : 192.168.0.5 UserName : Administrator

Python Code:

from pypsrp.powershell import PowerShell, RunSpacePool from pypsrp.wsman import WSMan

wsman - WSMan("192.168.0.5", username="Administrator", Password="******", auth="kerberos", cert_validation=False)

with RunspacePool(wsman) as pool: ps=PowerShell(pool) ps.add_cmdlet("get-process".add_cmtlet("select-object").add_argument("Name") output = ps.invoke() print(output)

Output: [win Error 10061] No connection could be made because the target machine actively refused it.

any changes need to made in virtual windows machine ?

jeenokia avatar Aug 20 '19 16:08 jeenokia