Hello
Do You how to get the list of actual users that are logged into HP SM in JS.
In application I can use the status format to see this. But I need it in my JS function.
Can anyone know how to achieve this?
Thanks
Darek
Hello
Do You how to get the list of actual users that are logged into HP SM in JS.
In application I can use the status format to see this. But I need it in my JS function.
Can anyone know how to achieve this?
Thanks
Darek
I'd go for: system.functions.
Because there is no JS equivalent.
Hello
Could You give me a expample of that function and it is possible to use this is JS. I want to copy actual logged user to database table is any other way than JS for this?
there is an example of this in the help files as shown below....
varusersXML = system.users;//If you uncomment the line of code, recompile, and run the script again, you can view the suppressed output. It prints all logged on users as a large XML document.
//print( usersXML );This part of the script loops through to process each <user> element within <users>.for( userIndex in usersXML )
{var userXML = usersXML[userIndex];//If you uncomment the line of code, recompile, and run the script again, you can view the suppressed output. It prints an individual user as an XML document.
//print( userXML );This part of the script loops through to process each XML element node within the <user> element.for( fldIndex in userXML )
{
var node = userXML[fldIndex];
print( node.getName() +": "+node.getValue() );
}
}
You can also do this with file manipulation, similar to the way kill.inactive does it
var status = new SCFile("status");
status.processes = system.functions.processes();
Then you can read through status.processes[i].user_name to see logged in users. Look at the status dbdict to see what the processes structured array looks like.
Thanks very much it work excellent
Here is the code to get the logged in users to windows application.
var status = new SCFile("status");
status.processes = system.functions.processes();
var proc = status.processes ;
for (var i = 0; i < proc.length(); i++)
{
if(status.processes[i].terminal_id.substring(0,4) == "Soap")
{
p("---" + status.processes[i].user_name + " ---" + status.processes[i].terminal_id);
}
}
Last edited by meton00; 2009-12-17 at 10:57.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks