AWS SDK Version 3 for .NET
API Reference

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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.IdentityManagement.AmazonIdentityManagementServiceRequest
      Amazon.IdentityManagement.Model.ChangePasswordRequest

Namespace: Amazon.IdentityManagement.Model
Assembly: AWSSDK.IdentityManagement.dll
Version: 3.x.y.z

Syntax

C#
public class ChangePasswordRequest : AmazonIdentityManagementServiceRequest
         IAmazonWebServiceRequest

The ChangePasswordRequest type exposes the following members

Constructors

NameDescription
Public Method ChangePasswordRequest()

Properties

NameTypeDescription
Public Property 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 (\u0020) through the end of the ASCII character range (\u00FF). You can also include the tab (\u0009), line feed (\u000A), and carriage return (\u000D) characters. Any of these characters are valid in a password. However, many tools, such as the Amazon Web Services Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.

Public Property OldPassword System.String

Gets and sets the property OldPassword.

The IAM user's current password.

Examples

The following command changes the password for the current IAM user.

To change the password for your IAM user


var client = new AmazonIdentityManagementServiceClient();
var response = client.ChangePassword(new ChangePasswordRequest 
{
    NewPassword = "]35d/{pB9Fo9wJ",
    OldPassword = "3s0K_;xh4~8XXI"
});


            

Version Information

.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