Credentials validation uses built-in Windows or, if set up, Micro Focus OES capabilities and can fail only if the credentials are invalid on both the workstation and the domain.

Command Line Tool

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.

Command line parameters for le.exe

Parameter Description
\\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]
-logon *
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.
-logoff [username]
-logoff *
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.
-lock [username]
-lock *
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]] 
[-setUSERparams 
[LogonAtStartup=X]
[KeepLoggedOn=X]
[UnlockByThisUser=X]]
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.
-addOESUser Sets or overrides the user's Micro Focus OES credentials stored in LogonExpert.
-setUSERparams Sets optional logon parameters for the user. The following optional logon parameters can be set to either 1 (turn on), or 0 (turn off):
LogonAtStartup Enables automatic logon on startup.
KeepLoggedOn Keeps the user logged on.
UnlockByThisUser Marks the user as one under whom LogonExpert will always keep the computer unlocked. Only one user at a time can be marked like this.
-removeuser username Removes the user from the list of configured users. The asterisk (*) can be used to remove all 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.
-setparams 
[EnableScheduler=X]
[AllowUsersConfigure=X]
[AllowAutologonInSafeMode=X]
[KeepComputerUnlocked=X]
[LockPCAfterLogon=X]
[CancelAutologonByShift=X]
[HideLogonUI=X]
[ShowLogo=X]
[BypassLegalNotice=X]
[AllowConfigTransfer=X]
[AllowRemoteAdmin=X]
[DelayPCLock=X]
[DelayLogon=X]
[DelayNextLogon=X]
Changes the LogonExpert settings.
The following options can be set to either 1 (turn on), or 0 (turn off):
EnableScheduler Enables the built-in scheduler.
AllowUsersConfigure Allows unprivileged users to configure LogonExpert.
AllowAutologonInSafeMode Allows autologon when Windows loads in Safe Mode.
KeepComputerUnlocked Keeps the computer unlocked under the user configured with the UnlockByThisUser parameter.
LockPCAfterLogon Locks the computer after logon.
CancelAutologonByShift Cancels autologon when SHIFT is pressed.
HideLogonUI Hides Windows sign-in interface during autologon.
ShowLogo Shows the LogonExpert logo.
BypassLegalNotice Bypasses the legal notice during autologon.
AllowConfigTransfer Makes the users’ credentials encrypted without hardware dependences. Allows you to use the logon.ini on other computers.
AllowRemoteAdmin Allows remote administration.
The following options can be either set to the required number of seconds (turn on), or 0 (turn off):
DelayPCLock Delays the post-logon lock for X seconds.
DelayLogon Delays logon on startup for X seconds.
DelayNextLogon Delays all subsequent startup logons by X seconds. The delay is applied to all users with autologon enabled by the LogonAtStartup parameter.
Examples: 
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.

Return codes for le.exe

The le.exe tool may return one of the following exit codes.

Return Code Description
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.

Calling сommands via DLL

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;

where CMDLine is a command line parameter for the le.exe.
Example: -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)

Notes