Jump to content

Recommended Posts

Posted (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.

 

Global $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 by Jos
added codebox
Posted (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 by Andreik
Posted

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,
 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...