| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
System

# Method System.LogonUser()

Method LogonUser

  `object LogonUser(string username, string|int(0..0) domain, string password, int|void logon_type, int|void logon_provider)`

Description

  Logon a user.

Parameter `username`

  User name of the user to login.

Parameter `domain`

  Domain to login on, or zero if local logon.

Parameter `password`

  Password to login with.

Parameter `logon_type`

  One of the following values:

  `LOGON32_LOGON_BATCH` |
  `LOGON32_LOGON_INTERACTIVE` |
  `LOGON32_LOGON_SERVICE` |
  `LOGON32_LOGON_NETWORK` | This is the default.

Parameter `logon_provider`

  One of the following values:

  `LOGON32_PROVIDER_DEFAULT` | This is the default.

Returns

  Returns a login token object on success, and zero on failure.

Note

  This function is only available on some Win32 systems.