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

Got WinRMOperationTimeoutError when using python winrm library to call a local powershell script on a windows server #324

Closed
condescendent opened this issue Jul 22, 2021 · 2 comments

Comments

@condescendent
Copy link

I am trying to user winrm library to call a local powershell script to stop MS SQL server engine service from a Lambda function. I got the below error. The connection was established successfully.

The log for establishing connection:

Establishing connection to 10.251.3.22

Connection established

The error I got after the above two logs.

[ERROR] WinRMOperationTimeoutError
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 237, in lambda_handler
result = session.run_ps('c:\shutdown_script.ps1')
File "/var/task/winrm/init.py", line 52, in run_ps
rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))
File "/var/task/winrm/init.py", line 39, in run_cmd
shell_id = self.protocol.open_shell()
File "/var/task/winrm/protocol.py", line 166, in open_shell
res = self.send_message(xmltodict.unparse(req))
File "/var/task/winrm/protocol.py", line 265, in send_message
raise WinRMOperationTimeoutError()

@condescendent
Copy link
Author

@jborean93
Copy link
Collaborator

Duplicate of #323

@jborean93 jborean93 marked this as a duplicate of #323 Aug 26, 2021
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

2 participants