Resets a user's password to a new, automatically generated password.
Namespace: Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2017.0.101.17 (2017.0.101.17)
Syntax
C# |
---|
[ObsoleteAttribute("You need to use ResetPassword or ForcePassword methods in {VGSecurityRuntime.Membership}")] public string ResetPassword( string name, bool ignoreRequiresQuestionAndAnswer ) |
Visual Basic |
---|
<ObsoleteAttribute("You need to use ResetPassword or ForcePassword methods in {VGSecurityRuntime.Membership}")> Public Function ResetPassword ( name As String, ignoreRequiresQuestionAndAnswer As Boolean ) As String |
Parameters
- name
- Type: System..::..String
The name of the user to reset the password for.
- ignoreRequiresQuestionAndAnswer
- Type: System..::..Boolean
When the value is true ignore the option RequiresQuestionAndAnswer and reset the password.
Return Value
Type: StringThe new password for the specified user.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | The name is null. |
System..::..ArgumentException | The name is longer than 64 characters orThe name is empty. |
Novalys.VisualGuard.Security.Membership..::..VGMembershipPasswordException |
The user account is currently locked out or does not exist.
- or - The generated password does not pass the password policy validation. |
System..::..NotSupportedException | RequiresQuestionAndAnswer is set to true and ignoreRequiresQuestionAndAnswer is set to false. orEnablePasswordReset is not set to true. orthe repository does not support Visual Guard authentication mode. |
System.Security..::..SecurityException | ignoreRequiresQuestionAndAnswer is true and the current user does not have enough privileges to ignore password answer. The Membership access level of the application must be sufficient to allows this action or the 'Membership Manager' role must be granted to the user by using the Visual Guard console. |