AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the ChangePassword operation. Changes the password of the IAM user who is calling this operation. This operation can be performed using the CLI, the Amazon Web Services API, or the My Security Credentials page in the Amazon Web Services Management Console. The Amazon Web Services account root user password is not affected by this operation.
Use UpdateLoginProfile to use the CLI, the Amazon Web Services API, or the Users page in the IAM console to change the password for any IAM user. For more information about modifying passwords, see Managing passwords in the IAM User Guide.
Namespace: Amazon.IdentityManagement.Model
Assembly: AWSSDK.IdentityManagement.dll
Version: 3.x.y.z
public class ChangePasswordRequest : AmazonIdentityManagementServiceRequest IAmazonWebServiceRequest
The ChangePasswordRequest type exposes the following members
Name | Description | |
---|---|---|
ChangePasswordRequest() |
Name | Type | Description | |
---|---|---|---|
NewPassword | System.String |
Gets and sets the property NewPassword. The new password. The new password must conform to the Amazon Web Services account's password policy, if one exists.
The regex pattern that is used to validate
this parameter is a string of characters. That string can include almost any printable
ASCII character from the space ( |
|
OldPassword | System.String |
Gets and sets the property OldPassword. The IAM user's current password. |
The following command changes the password for the current IAM user.
var client = new AmazonIdentityManagementServiceClient(); var response = client.ChangePassword(new ChangePasswordRequest { NewPassword = "]35d/{pB9Fo9wJ", OldPassword = "3s0K_;xh4~8XXI" });
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5