0

Hello im trying to connect to windows vps sever, but iget this error :

Traceback (most recent call last):
  File "C:\Users\uwu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "C:\Users\win\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
    raise err
  File "C:\Users\uwu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
    sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

And :

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x03AFF2D0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

My code :

import winrm

s = winrm.Session('127.0.0.1', auth=('administrator', 'Something'))
r = s.run_cmd('ipconfig', ['/all'])
r.status_code
r.std_out
r.std_err

P.S 0: im trying to connect to windows sever 2012 P.S 1: if there is batter way to connect to rm server pls share it with me.

SHAHIN a
  • 1
  • 2

0 Answers0