Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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
userName
Type: System.StringThe user account name.
password
Type: System.Security.SecureStringThe password for the user account.
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