Hi,
I want to run following script to check SAP-GUI sessions.
In rz11 sapgui/user_scripting_per_user is set to "TRUE" - but the script means, that guiConn.DisabledByServer is true!!
Though I cannot connect to an existing SAPGUI-session.
Any idea?
Tnx.
Now the script
WScript.echo("connecting to SAP GUI")
Set sapGUI = GetObject("SAPGUI")
If(sapGUI Is Nothing) Then
WScript.echo("ERROR: No SAP GUI found")
WScript.Quit 1
End If
WScript.echo("SAP GUI connected, connecting to script engine")
Set guiApp = sapGUI.GetScriptingEngine
If(guiApp Is Nothing) Then
WScript.echo("ERROR: scripting engine not available")
WScript.Quit 1
End If
WScript.echo("Scripting Engine available")
WScript.echo(" Version " & CStr(guiApp.MajorVersion) & "." & CStr(guiApp.MinorVersion) & " Patch " & CStr(guiApp.PatchLevel) & " Revision " & CStr(guiApp.Revision))
WScript.echo(CStr(guiApp.connections.Count) & " connection(s) available")
For Each guiConn In guiApp.Connections
WScript.echo(" connection " & guiConn.description)
WScript.echo(" disabled by server : " & CStr(guiConn.DisabledByServer))
WScript.echo(" connection string : " & CStr(guiConn.ConnectionString))
if(guiConn.Sessions.Count > 0) then
set guiSess = guiConn.Sessions(0)
WScript.echo(" application server : " & CStr(guiSess.Info.ApplicationServer))
WScript.echo(" message server : " & CStr(guiSess.Info.MessageServer))
WScript.echo(" group : " & CStr(guiSess.Info.Group))
WScript.echo(" system name : " & CStr(guiSess.Info.SystemName))
WScript.echo(" system number : " & CStr(guiSess.Info.SystemNumber))
WScript.echo(" client : " & CStr(guiSess.Info.Client))
WScript.echo(" user : " & CStr(guiSess.Info.User))
WScript.echo(" language : " & CStr(guiSess.Info.Language))
WScript.echo(" code page : " & CStr(guiSess.Info.CodePage))
end if
WScript.echo(" sessions : " & CStr(guiConn.Sessions.Count))
For Each guiSess In guiConn.Sessions
WScript.echo(" session " & CStr(guiSess.Info.SessionNumber))
WScript.echo(" busy : " & CStr(guiSess.Busy))
WScript.echo(" session information")
WScript.echo(" transaction : " & CStr(guiSess.Info.Transaction))
WScript.echo(" program : " & CStr(guiSess.Info.Program))
WScript.echo(" screen number : " & CStr(guiSess.Info.ScreenNumber))
WScript.echo(" performance information")
WScript.echo(" response time : " & CStr(guiSess.Info.ResponseTime))
WScript.echo(" interpretation time: " & CStr(guiSess.Info.InterpretationTime))
WScript.echo(" flushes : " & CStr(guiSess.Info.Flushes))
WScript.echo(" round trips : " & CStr(guiSess.Info.RoundTrips))
Next
Next
WScript.Quit 0
----------------------------------
And this is the output