AutoIT is basically a way of automating stuff in the windows GUI and has lots of uses.
Here is an working launcher and example script for SSMS with SQL Authentication since ssms.exe >v.18.0 no longer supports command line arguments. All steps:
-
Install AUTO IT on to the RDS server
-
Create attached scrtipt and compile into an executable
- Create security template and custom launcher to pass credentials and host information to the AutoIt script executable.
Install AutoIt
Download url : https://ift.tt/3zn9sCG
Create and Compile AutoIt Script
Below is the example script to launch SSMS.exe and complete SQL Auth :
;Thycotic ssms.exe with sql credential launcher script
;set filepath of ssms.exe
$Path = "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"
;execute ssms.exe
ShellExecute($Path)
;Wait for the 'connect to server' window to appear
WinWaitActive("Connect to Server", "", 0)
;set auth mode to SQL authenticaiton
ControlSend("Connect to Server" , "" , "[NAME:comboBoxAuthentication]", "[NAME:SQL]")
;set server instance to servername passed from Secret Server launcher in cmd line parameter 1
ControlSetText("Connect to Server", "", "[NAME:serverInstance]", $CmdLine[1],1)
;set username to username passed from Secret Server launcher in cmd line parameter 2
ControlSetText("Connect to Server", "", "[NAME:userName]", $CmdLine[2],1)
;set password to password passed from Secret Server launcher in cmd line parameter 3
ControlSetText("Connect to Server", "", "[NAME:password]", $CmdLine[3],1)
;reactivate the connect to server window, required for the click of buttons within the window
WinActivate ("Connect to Server")
;click the connect button
ControlClick("Connect to Server", "", "[NAME:connect]")
Compile (go to Tools on toolbar and select Compile)
Save .exe to a location accessible to all users (c:\autoit in my case)
Create Launcher
Create a regular session connector launcher and use the above child launcher
Create a new secret template and pass servername, username and password.
via Blogger https://ift.tt/3BukjMR
July 22, 2021 at 09:31AM Thycotic