Most features of LogonExpert are accessible from the command line. A special executable file (le.exe) located in the LogonExpert installation folder should be used for this purpose. After the program is installed, the le.exe file is available from any working directory, so there is no need to use the full path to call it. The tool cannot be used on a system where LogonExpert is not installed.
The le.exe file needs to be run under an account with administrative privileges in case the Allow unprivileged users to configure LogonExpert check box on the Options tab is unchecked.
The acceptable command line parameters are listed below.
|\\computer [-u:domain\user [-p:password]]||Directs the le.exe to execute the commands on the specified computer. A username and password can optionally be provided for remote authentication. Only administrator accounts are allowed on the remote side.|
-logon username [password] [domain]
|Logs on the user whose credentials are listed first in the LogonExpert settings or provided as the optional parameters. Can also be used to unlock the computer. Fails to if the credentials cannot be validated by LogonExpert. The asterisk (*) can be used to log on all configured users.|
|Logs off the console user or the one specified as the optional parameter. Performs no action if the user is not logged on. The asterisk (*) can be used to log off all currently logged on users.|
|Locks the computer (console session) or the user specified as the optional parameter (usually, the remote desktop user's session). Performs no action if the user's session is already locked. The asterisk (*) can be used to lock all of the computer's logged on sessions including the remote desktop users' sessions.|
-adduser username [password] [domain]
[-addOESUser username [password]]
Adds new or overrides existing user settings in LogonExpert. Fails to if
the Windows (or, optionally, Micro Focus OES) credentials cannot be
validated by LogonExpert.
|-removeuser username||Removes the user from the list of configured users. All scheduled tasks associated with the user are also deleted.|
|-listusers||Retrieves a list of all users configured in LogonExpert.|
|-force||Forces LogonExpert to use the credentials defined with the -logon and -adduser commands even if they failed to be validated.|
|-t xx||Defines a logon/logoff timeout (in seconds). Uses the default value of 120 seconds if the parameter is not set. Exit code 3 is returned if a logon/logoff cannot be performed by LogonExpert within the specified time.|
Changes the LogonExpert settings.
The following options can be set to either 1 (turn on), or 0 (turn off):
le -setparams ShowLogo=0
Hides the LogonExpert logo.
le -setparams DelayPCLock=60
Enables a delay for the post-logon lock and sets it to 1 minute.
le -setparams DelayLogon=0
Disables the pre-logon delay on startup.
|-?||Lists the above parameters.|
The le.exe tool may return one of the following exit codes.
|0||The command has been executed successfully.|
|1||Error: The required files have not been found. Please reinstall LogonExpert.|
|2||Error: The logon credentials cannot be validated.|
|3||Error: The user cannot be logged on/logged off within the allotted time.|
|4||Error: LogonExpert is configured to reject remote connections on the remote computer. Please contact your system administrator.|
|5||Error: The remote computer has not been found on the network.|
|6||Error: The LogonExpert service is not installed or running. LogonExpert might not have been installed properly.|
|7||Error: This action cannot be performed due to the license being invalid. Please launch LogonExpert Administrator for additional information.|
|8||Error: You do not have appropriate rights to run LogonExpert. Please launch LogonExpert Administrator and configure the rights on the Options tab.|
|9||Error: The logon has been interrupted with the Shift key.|
|10||Error: The connection has timed out. Please select another computer with LogonExpert installed.|
|11||Error: An incompatible version of LogonExpert has been detected on the remote computer. Please consider updating it.|
|12||Error: Access has been denied. The remote copy of LogonExpert requires that you authenticate yourself as a local or domain administrator.|
|13||Error: The logon has been interrupted.|
|14||Error: No -setparams parameters have been specified.|
|15||Error: Unknown -setparams parameters.|
|16||Error: The UnlockByThisUser and LockPCAfterLogon parameters cannot share the same value.|
|17||Error: The user is not allowed to perform the requested type of logon on this computer.|
|18||Error: No such user has been found.|
|19||Error: No users have been configured so far.|
|20||Error: No eDirectory tree is configured for this user.|
LogonExpert comes with two special DLL wrappers, LECmdx32.dll and LECmdx64.dll. Both libraries are included in the LogonExpert installation and located in the \APIs\LECmdWrapper subfolder. Usage examples for PowerShell scripts, C#, C++, and Delphi can be found in the \APIs\LECmdWrapper\Examples subfolder.
The DLLs export the following function:
uint LECommandLine(string CMDLine);
DWORD LECommandLine([in] const wchar_t* CMDLine);
function LECommandLine(CMDLine: PWideChar): DWORD; stdcall;
CMDLine is a command line parameter for the le.exe.
-logon USER PASSWORD DOMAIN
The return codes are the same as those for the command line tool (see above), plus an additional one:
4294967295 (0xFFFFFF) – Could not execute the le.exe (LogonExpert is not installed or the le.exe is missing. Reinstall LogonExpert)