Sample Exchange

 View Only

ABX action to OpenSSH to a Windows Server 

Sep 28, 2021 02:49 PM

Recently I needed to create a connection to a Windows server and perform some operations on it. From there I wanted to run commands on the Windows server itself, and I didnt want to have to worry about double hop WinRM issues from PowerShell. I wanted something flexible that I could use as a template moving forwards. After a fair bit of fiddling I finally got it to work and even better, I didnt need vRO, it could all be completed from an extensibility action written in Python. Below is the code demonstrating the execution of a simple Windows command, ipconfig. If you were using this in production, you would obviously use Action Constants to keep the username, password and IP details secure, admitted here to make it easier for you to follow. In addition, you may want to look into using an SSH key and amending the set_missing_host_key_policy method.

Note that the code has a dependency on a Python library, called paramiko. You will need to enter specify this dependency to obtain the library and have it injected into the ABX container at runtime

More information can be found on my blog.


#vRA
#SSH
#Apache2.0
#vRealizeAutomation
#python
#Python
#abx
#windows
#vRA8.1
#openssh

Statistics
0 Favorited
0 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
py file
snippet.py   812 B   1 version
Uploaded - Apr 09, 2024

Tags and Keywords

Related Entries and Links

No Related Resource entered.