Partager via


UserIdentity.LogonUser Method (String, SecureString)

 

Logs on with the specified user account name and password.

Namespace:   Microsoft.WindowsServerSolutions.Users
Assembly:  UserObjectModel (in UserObjectModel.dll)

Syntax

public static UserIdentity LogonUser(
    string userName,
    SecureString password
)
public:
static UserIdentity^ LogonUser(
    String^ userName,
    SecureString^ password
)
Public Shared Function LogonUser (
    userName As String,
    password As SecureString
) As UserIdentity

Parameters

Return Value

Type: Microsoft.WindowsServerSolutions.Users.UserIdentity

An instance of UserIdentity.

Exceptions

Exception Condition
UserException

The log on attempt was not successful.

See Also

UserIdentity Class
Microsoft.WindowsServerSolutions.Users Namespace

Return to top