Promotic

AddUser - method of the Pm object

Description:
Adds new PROMOTIC user.
Syntax:
Boolean AddUser(String sId, String sParams)
Parameters:
sId(String) New (local or net) user identifier.
sParams(String) Additional parameters of the created user. Entries are in the KeyVal format, for example "type:local;stored:tmp;groups:$ADMIN,$OPER;name:test;password:test;priority:5;".
"type:local/net;" - User type (local = local user, net = network user).
"stored:ini/tmp;" - User configuration saving method, where ini means saving into local INI text file and tmp means saving temporarily in computer´s memory.
"groups:group1,group2,...;" - User groups list (the groups are separated by ',' comma), the new user belongs to.
"name:sss;" (optional) - User name (default = empty string).
The login name is mandatory for local users.
The login name is optional for network user, the empty value means that the login name and password is not tested.
"password:sss;" (optional) - User password (default is empty).
"priority:nnn;" (optional) - The user priority in the range 0-100, where 0 means the lowest priority and 100 means the highest priority.
"ipaddress:nnn.nnn.nnn.nnn;" (optional) - Computer IP address, the network user is enabled to log in from (default is empty). Empty value means that the network user IP address is not checked.
Return value:
true - user was added succesfully
false - new user adding failed
Note:
This method is not functional in Web panels.
Example1:
Temporary local PROMOTIC user L_TEST creation, with the login name test, password t and priority 5, included in $ADMIN and $OPER groups.
JavaScriptVBScriptSelect and copy to clipboard

var bUser = Pm.AddUser("L_TEST", "type:local;stored:tmp;groups:$ADMIN,$OPER;name:test;password:t;priority:5;");
Example2:
Temporary network PROMOTIC user N_TEST creation, with the login name test and password t, included in $ADMIN and $OPER groups, limited solely to 192.168.0.5 IP adress.
JavaScriptVBScriptSelect and copy to clipboard

var bUser = Pm.AddUser("N_TEST", "type:net;stored:tmp;groups:$ADMIN,$OPER;name:test;password:t;ipaddress:192.168.0.5;");
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- AddUser
 
 
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.