ESRI.ArcGIS.ADF.Core
LogonUser Method
See Also  Send comments on this topic.
ESRI.ArcGIS.ADF Namespace > Impersonation Class : LogonUser Method




userName
String value that specifies the name of the user. This is the name of the user account to log on to. If you use the UPN format, user@DNS_domain_name, the Domain parameter must be NULL.
password
String that specifies the clear-text password for the user account specified by Username
domain
String value that specifies the name of the domain or server account whose database contains the UserName account. If this parameter is NULL, the user name must be specified in UPN format. If this parameter is ".", the function validates the account using only the local account database.
logonSessionType
The type of logon to perform.
token
A pointer to a handle variable that receives a handle to a token that represents the specified user.
Managed wrapper around Win32 LogonUser API

Syntax

Visual Basic (Declaration) 
Public Shared Function LogonUser( _
   ByVal userName As String, _
   ByVal password As String, _
   ByVal domain As String, _
   ByVal logonSessionType As Impersonation.LogonSessionType, _
   ByRef token As IntPtr _
) As Boolean
Visual Basic (Usage)Copy Code
Dim userName As String
Dim password As String
Dim domain As String
Dim logonSessionType As Impersonation.LogonSessionType
Dim token As IntPtr
Dim value As Boolean
 
value = Impersonation.LogonUser(userName, password, domain, logonSessionType, token)
C# 
public static bool LogonUser( 
   string userName,
   string password,
   string domain,
   Impersonation.LogonSessionType logonSessionType,
   out IntPtr token
)

Parameters

userName
String value that specifies the name of the user. This is the name of the user account to log on to. If you use the UPN format, user@DNS_domain_name, the Domain parameter must be NULL.
password
String that specifies the clear-text password for the user account specified by Username
domain
String value that specifies the name of the domain or server account whose database contains the UserName account. If this parameter is NULL, the user name must be specified in UPN format. If this parameter is ".", the function validates the account using only the local account database.
logonSessionType
The type of logon to perform.
token
A pointer to a handle variable that receives a handle to a token that represents the specified user.

Return Value

True if success, false if failed

See Also

© 2010 All Rights Reserved.