- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
10-09-2019 09:46 PM
@Himanshu Pandey Could you share me the script for PSM SQL Developer ? my email: [email protected]
12-01-2019 05:12 PM
Hi Guys,
AutoIT3 finder tools is unable to capture the Basic Control Info? Any one experiencing the same issue.
Do we have a sample script for SQL Developer.
Thanks
PY
01-13-2020 05:53 PM
Hi Guys,
I have managed to fixed it and PSM-SQLDeveloper is working for me. Please let me know if you need any help.
Thanks
PY
01-13-2020 06:00 PM
Hi Guys,
I have managed to fixed it and PSM-SQLDeveloper is working for me. Please let me know if you need any help.
Thanks
PY
02-19-2020 02:31 PM
03-06-2020 11:47 AM
@Himanshu Pandey Hi HP !!!Do you have SQL Developer script ? Can you provide it to me ?
03-06-2020 11:47 AM
@Himanshu Pandey Hi HP !!!Do you have SQL Developer script ? Can you provide it to me ?
03-24-2020 08:48 AM
thanks I would love the script as well!
03-30-2020 08:04 PM
Hi @Prem Yadav are you able to share the working SQL developer script? [email protected]
04-08-2020 04:46 AM
Hi ,
is anyone have any idea about this error..I am getting this error in one of the PSM server.
04-15-2020 12:10 PM
Can you please share the AutoIT script for PSM-SQLDeveloper? Please and thank you!
04-16-2020 06:13 AM
#AutoIt3Wrapper_UseX64=n
Opt("MustDeclareVars", 1)
AutoItSetOption("WinTitleMatchMode", 1) ; Match prefix
;============================================================
; PSM AutoIt SQL Developer Dispatcher
;============================================================
#include "PSMGenericClientWrapper.au3"
;=======================================
; Consts & Globals
;=======================================
Global Const $DISPATCHER_NAME = "SQL Developer"
Global Const $CLIENT_EXECUTABLE = "D:\Program Files (x86)\sqldeveloper\sqldeveloper.exe"
Global Const $ERROR_MESSAGE_TITLE = "PSM " & $DISPATCHER_NAME & " Dispatcher error message"
Global Const $LOG_MESSAGE_PREFIX = $DISPATCHER_NAME & " Dispatcher - "
Global $TargetUsername
Global $TargetPassword
Global $TargetAddress
Global $TargetPort
Global $TargetDatabase
Global $ConnectionClientPID = 0
;=======================================
; Code
;=======================================
Exit Main()
;=======================================
; Main
;=======================================
Func Main()
; Init PSM Dispatcher utils wrapper
ToolTip ("Initializing...")
LogWrite("successfully initialized tooltip")
if (PSMGenericClient_Init() <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
LogWrite("successfully initialized Dispatcher Utils Wrapper")
; Get the dispatcher parameters
FetchSessionProperties()
LogWrite("mapping local drives")
if (PSMGenericClient_MapTSDrives() <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
LogWrite("starting client application")
ToolTip ("Starting " & $DISPATCHER_NAME & "...")
$ConnectionClientPID = Run($CLIENT_EXECUTABLE)
if ($ConnectionClientPID == 0) Then
Error(StringFormat("Failed to execute process [%s]", $CLIENT_EXECUTABLE, @error))
EndIf
; Send PID to PSM as early as possible so recording/monitoring can begin
LogWrite("sending PID to PSM")
if (PSMGenericClient_SendPID($ConnectionClientPID) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
; ------------------
;Block all input for the remainder of the SQL Developer application interaction
LogWrite("Starting Customized Plugin Code...")
Local $hWnd
$hWnd = WinWaitActive("[REGEXPTITLE:(Oracle SQL Developer.*|Confirm Import Preferences|Oracle Usage Tracking)]", "", 10)
; Check if the "Confirm Import Preferences" dialog is displayed
If (WinGetTitle($hWnd) == "Confirm Import Preferences") Then
; Get rid of it
Send("!n")
; Wait for the main window again
$hWnd = WinWaitActive("[REGEXPTITLE:(Oracle SQL Developer.*|Oracle Usage Tracking)]", "", 10)
EndIf
; The "Oracle Usage Tracking" dialog may appear after the main window becomes active - we need to wait a bit and check again.
Sleep(400)
$hWnd = WinWaitActive("[REGEXPTITLE:(Oracle SQL Developer.*|Oracle Usage Tracking)]", "", 10)
; Check if the "Oracle Usage Tracking" dialog is displayed
If (WinGetTitle($hWnd) == "Oracle Usage Tracking") Then
; Get rid of it
Send("{SPACE}")
Sleep(400)
Send("{ENTER}")
; Wait for the main window again
$hWnd = WinWaitActive("Oracle SQL Developer", "", 10)
EndIf
;if ($hWnd == 0) Then
;Error("SQL Developer initialization timed out")
;EndIf
;Sleep(1000)
;Send("!w")
;Send("!f")
;Send("{ENTER}")
;Sleep(3000)
;$hWnd = WinWaitActive("Oracle SQL Developer", "", 10)
;if ($hWnd == 0) Then
;Error("SQL Developer initialization timed out")
;EndIf
Send("{ENTER}")
WinWaitActive("Oracle SQL Developer : Start Page")
WinSetState("Oracle SQL Developer", "", @SW_MAXIMIZE)
Send("{ENTER}")
Sleep(100)
MouseClick("left", 15, 117)
$hWnd = WinWaitActive("New / Select Database Connection", "", 5) ; Should not take more than a second to appear
if ($hWnd == 0) Then
Error("Failed to click on connection button")
EndIf
Send("PSM UC [" & $TargetUsername & "@" & $TargetAddress & "]")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send($TargetUsername)
Sleep(100)
Send("{TAB}")
Sleep(1000)
Send($TargetPassword, 1)
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send($TargetAddress)
Sleep(100)
Send("{TAB}")
Sleep(100)
Send($TargetPort)
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send("{SPACE}")
Sleep(100)
Send("{TAB}")
Sleep(100)
Send($TargetDatabase)
Send("!o")
;-- if we get the overwrite dialog, send 'Yes'
Sleep(500)
If WinActive("Connection Name in use") Then
Send("!y")
EndIf
; ------------------
; Terminate PSM Dispatcher utils wrapper
LogWrite("Terminating Dispatcher Utils Wrapper")
PSMGenericClient_Term()
Return $PSM_ERROR_SUCCESS
EndFunc
;==================================
; Functions
;==================================
; #FUNCTION# =============================================================================
Func Error($ErrorMessage, $Code = -1)
; If the dispatcher utils DLL was already initialized, write an error log message and terminate the wrapper
if (PSMGenericClient_IsInitialized()) Then
LogWrite($ErrorMessage, True)
PSMGenericClient_Term()
EndIf
Local $MessageFlags = BitOr(0, 16, 262144) ; 0=OK button, 16=Stop-sign icon, 262144=MsgBox has top-most attribute set
MsgBox($MessageFlags, $ERROR_MESSAGE_TITLE, $ErrorMessage)
; If the connection component was already invoked, terminate it
if ($ConnectionClientPID <> 0) Then
ProcessClose($ConnectionClientPID)
$ConnectionClientPID = 0
EndIf
Exit $Code
EndFunc
; #FUNCTION# ====================================================================================================================
; Name...........: LogWrite
; Description ...: Write a PSMWinSCPDispatcher log message to standard PSM log file
; Parameters ....: $sMessage - [IN] The message to write
; $LogLevel - [Optional] [IN] Defined if the message should be handled as an error message or as a trace messge
; Return values .: $PSM_ERROR_SUCCESS - Success, otherwise error - Use PSMGenericClient_PSMGetLastErrorString for details.
; ===============================================================================================================================
Func LogWrite($sMessage, $LogLevel = $LOG_LEVEL_TRACE)
Return PSMGenericClient_LogWrite($LOG_MESSAGE_PREFIX & $sMessage, $LogLevel)
EndFunc
; #FUNCTION# =============================================================================
; Name...........: PSMGenericClient_GetSessionProperty
; Description ...: Fetches properties required for the session
;================
Func FetchSessionProperties()
if (PSMGenericClient_GetSessionProperty("Username", $TargetUsername) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
if (PSMGenericClient_GetSessionProperty("Password", $TargetPassword) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
if (PSMGenericClient_GetSessionProperty("Address", $TargetAddress) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
if (PSMGenericClient_GetSessionProperty("Port", $TargetPort) <> $PSM_ERROR_SUCCESS) Then
$TargetPort =
EndIf
if (PSMGenericClient_GetSessionProperty("Database", $TargetDatabase) <> $PSM_ERROR_SUCCESS) Then
Error(PSMGenericClient_PSMGetLastErrorString())
EndIf
EndFunc
;Func _Quit()
;MsgBox("","Quitting","Something's wrong")
; Exit
;EndFunc
04-16-2020 06:13 AM
Let me know if it works
04-21-2020 12:07 PM
@Prem Yadav
I tried attaching the script to the connection component and I am hitting errors. Can you send me screenshots of what your connection component looks like in general? I have it setup like this:
PSM-SQLDeveloper
target settings:
Protocol - VNC
ClientApp - dummy.exe
ClientDispatcher - "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "{PSMComponentsFolder}\PSMsqldeveloperdispatcher.au3" "{PSMComponentsFolder}\"
ClientInvokeType - Dispatcher
PSMsqldeveloperdispatcher.au3 is the autoIT script that you sent me
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

