UserIdentity.ChangePassword Method (String, SecureString, SecureString)
Changes the password for the specified user account.
Namespace: Microsoft.WindowsServerSolutions.Users
Assembly: UserObjectModel (in UserObjectModel.dll)
Syntax
public static void ChangePassword(
string userName,
SecureString oldPassword,
SecureString newPassword
)
public:
static void ChangePassword(
String^ userName,
SecureString^ oldPassword,
SecureString^ newPassword
)
Public Shared Sub ChangePassword (
userName As String,
oldPassword As SecureString,
newPassword As SecureString
)
Parameters
userName
Type: System.StringThe name of the user account for which the password is changed.
oldPassword
Type: System.Security.SecureStringThe old password for the user account.
newPassword
Type: System.Security.SecureStringThe new password for the user account.
Exceptions
Exception | Condition |
---|---|
UserException | The user account is not valid. |
See Also
UserIdentity Class
Microsoft.WindowsServerSolutions.Users Namespace
Return to top