Hi,
I connect to the server via RDP. Is it possible to get the ID of the current session ?
Hi,
I connect to the server via RDP. Is it possible to get the ID of the current session ?
WTSEnumerateProcess populates a WTS_PROCESS_INFO structure with information pertaining to running processes on the specified host. If the hServer parameter is set to WTS_CURRENT_SERVER_HANDLE, this will run against the host which is running the software.
Could you please explain how do you create wmi ?
oList := wmi:Execquery( "select * from Win32_Process" )
oLocator := CREATEOBJECT( "wbemScripting.SwbemLocator" )
oWMI := oLocator:ConnectServer()Please try this:
oList := wmi:Execquery( "select * from Win32_Process" )
XBrowse( oList )
and post here what you get, thanks
WaitRun( "query user > users.txt" )
MsgInfo( MemoRead( "users.txt" ) )
query user [<username> | <sessionname> | <sessionID>] [/server:<servername>]
Would you mind to share the code that you used to solve it ?
many thanks
local PID, SID
local oList, oProc
oList:= oWmi:ExecQuery( "select * from Win32_Process'" )
for each oProc in oList
PID:=oProc:ProcessId
SID:=oProc:SessionId
exit
nextthank you