Scheme scripts for local users administration
Administrators can use Scheme scripts instead of NexJ Admin Console to create accounts for local users and reset user passwords. These scripts help make these tasks more efficient, especially when you need to create specific users prior to deployment.
The Scheme scripts are run in the Scheme Console available within NexJ Studio. Run the scripts as an Administrator, such as an Administrator with nexjsa permissions.
Info
Local users run server or background processes and are not included in the user registry.
Scheme script for creating local user accounts
The following script creates an account for a local user.
Syntax:
Info
Local users run server or background processes and are not included in the user registry.
(LocalUser'new (: <attribute1> <value1>)(: <attribute2> <value2>)...)
Info
The user account that is created will not have any privileges and should not be used for anything other than Java Message Service (JMS) authentication.
Example
In the following example, a local user account is created for Local User.
(let ((usr (LocalUser'new (: loginName "<local2>") (: alias "<local2>") (:
updatablePassword "<passWrd123>"))))
((usr'person)'lastName "<User>")
((usr'person)'firstName "<Local>")
)
Scheme script for resetting local user passwords
The following script resets a local user's password using the updatablePassword event.
Syntax:
updatablePassword "<newPassword>"
Example
In the following example, the user's password is set to passWrd123
.
(define usr (read-instance User '(name) '(= name "<user11>") #f))
(usr'updatablePassword "<passWrd123>")