Here is the VBSscript I've come up with. Since the server is Linux, I will launch it using WINE and the OS-COMMAND progress function.
Our users use the same UserID for QAD and Windows, so using the usr_mstr.usr_userID field, we can pass that as the first argument.
In our case, the server the users are running on is static, but we could also use a custom field in usr_mstr to hold the user's machine name. That gets passed as argument 2.
Lastly, we're going to try and launch a intranet site, including a record number, so that our users can fill out a web form tied to the QAD record in our document control system.
This script uses PSexec, so make sure to put it in the folder you have the script in.
so, the following:
Code:
cscript IERemoteLauncher.vbs USER SERVER WEBSITE
Find the session of the user on the server, and launch the website in an IE window on their session.
Here is the script.
Code:
'IERemoteLauncher.vbs
Set args = WScript.Arguments
SIDQuery = "query session "&args.Item(0)&" /Server "&args.Item(1)
Set oShell = CreateObject ("WScript.Shell")
Set oExec = oShell.Exec(SIDQuery)
Do While oExec.Status = 0
WScript.Sleep 5
Loop
myArray = Split(oExec.StdOut.ReadAll, vbCrLf)
SessionID = Mid(myArray(1),45,3)
LaunchString = "psexec -s -d -i "&SessionID&" \\"&args.Item(1)&" iexplore.exe """&args.Item(2)&""""
oShell.Exec(LaunchString)
'END