Mahmoud_Emad Posted February 12, 2024 Posted February 12, 2024 (edited) Hello, please help with login credentials variables for Forcepoint Security Management Center (SMC software). So, i can make seamless access for it. I have one for Microsoft SQL management Studio which script is listed below and need another one for SMC. expandcollapse popupGlobal $apppath = "" Global $appfolder = "" Global $account = $CmdLine[1] Global $password = $CmdLine[2] Global $asset = $CmdLine[3] $apppath = "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe" $appfolder = "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE" Global $loginwintitle = "Connect to Server" Start($apppath, $appfolder) Login($asset, $account, $password) Func Login($asst, $acct, $passwd) ; Wait for login window and get window handle when ready. Local $handle = WinWaitActive($loginwintitle) ; Disable the options and help buttons ControlDisable($handle, "", "[NAME:help]") ControlDisable($handle, "", "[NAME:options]") ; Disable control and set server type ControlDisable($handle, "", "[NAME:comboBoxServerType]") ControlSend($handle, "", "[NAME:comboBoxAuthentication]", "SelectString", "Database Engine") ; Disable control and set authentication to SQL ControlDisable($handle, "", "[NAME:comboBoxAuthentication]") ControlSend($handle, "", "[NAME:comboBoxAuthentication]", "SelectString", "SQL Server Authentication") ; Hide save password option ControlHide($handle, "", "[NAME:savePassword]") ; Disable control and set servername ControlDisable($handle, "", "[NAME:serverInstance]") ControlSetText($handle, "", "[NAME:serverInstance]", $asset) ; Disable control and set username ControlDisable($handle, "", "[NAME:userName]") ControlSetText($handle, "", "[NAME:userName]", $account) ; Disable control and set password ControlDisable($handle, "", "[NAME:password]") ControlSetText($handle, "", "[NAME:password]", $password) ; Connect ControlClick($handle, "", "[NAME:connect]") EndFunc Func Start($path, $folder) Run($path, $folder, @SW_MAXIMIZE) EndFunc Edited February 12, 2024 by Jos added codebox
Developers Jos Posted February 12, 2024 Developers Posted February 12, 2024 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Andreik Posted February 12, 2024 Posted February 12, 2024 (edited) Why would you want to automate SSMS when you can work directly with the MSSQL Engine? What exactly do you want to achieve and what's the point between SSMS and SMC? Edited February 12, 2024 by Andreik
Mahmoud_Emad Posted February 12, 2024 Author Posted February 12, 2024 Hello, I have app launcher to automate login without entering username and password i have done automating SMSS login with that way using AutoIT script above. i need to do the same for SMC, but can't reach the right variables for (username, password, login submit button). thanks,
Andreik Posted February 12, 2024 Posted February 12, 2024 Use AutoIt Window Info tool to see what kind of window and controls you are dealing with.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now