Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeenokia opened this issue Aug 20, 2019 · 0 comments

Comments

@jeenokia
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant