GetUserInfo - method of the Pm object
Syntax:
Variant GetUserInfo(String sParams)
Parameters:
sParams | (String) Additional parameters specify which information to be obtained. Entries are in the KeyVal format, for example "what:cfguserlist;type:local;".
"what:sss;" - The basic option specifies what to return.
what:cfguserlist; - User identifiers list (separated by comma).
what:cfggrouplist; - User groups identifiers list (separated by comma).
what:loguserarray; - An array of references to logged users ( PmUser objects). The number of logged users can be obtained by the UBound function.
"type:sss;" (optional) - Specifies whether to return all users, only local users or only network users.
If not set, then all users are returned (local and network).
type:local; - Only local users.
type:net; - Only network users. |
---|
Example1:
Obtains the list of all local users. First in the form of the user identificators list (separated by comma) followed by transfering the list into an array of identifiers.
JavaScriptVBScriptSelect and copy to clipboard
var sUsers = Pm.GetUserInfo("what:cfguserlist;type:local;");
var aUsers = Pm.StringSplit(sUsers, " ");
Dim sUsers
sUsers = Pm.GetUserInfo("what:cfguserlist;type:local;")
Dim aUsers
aUsers = Pm.StringSplit(sUsers, " ")
Example2:
Obtains an array of references to all logged users (
PmUser objects) followed by the list of each logged user identifier reported into the INFO system.
JavaScriptVBScriptSelect and copy to clipboard
var iUser;
var aUsers = Pm.GetUserInfo("what:loguserarray;type:net;");
var nUsers = aUsers.GetSize(1);
for (iUser = 0; iUser < nUsers; iUser++)
{
Pm.Debug(aUsers.GetItem(iUser).Id);
}
Dim iUser, aUsers, nUsers
aUsers = Pm.GetUserInfo("what:loguserarray;type:net;")
nUsers = UBound(aUsers) + 1
For iUser = 0 To nUsers - 1
Pm.Debug aUsers(iUser).Id
Next