Skip to content

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

@jeenokia

Description

@jeenokia

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions