There are more AWS SDK examples available in the AWS Doc SDK Examples
Use ResetUserPassword with a CLI
The following code examples show how to use ResetUserPassword.
- CLI
-
- AWS CLI
-
To reset a user password in a directory
The following
reset-user-passwordexample resets and enables the specified user in the specified directory.aws ds reset-user-password \ --directory-idd-1234567890\ --user-name 'john.doe' \ --new-password'password'This command produces no output.
For more information, see Resetting and enabling an AWS Managed Microsoft AD user's password in the AWS Directory Service Administration Guide.
-
For API details, see ResetUserPassword
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example resets the password of Active Direcotry user named ADUser in AWS Managed microsoft AD or Simple AD Directory
Reset-DSUserPassword -UserName ADuser -DirectoryId d-123456ijkl -NewPassword $Password-
For API details, see ResetUserPassword in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example resets the password of Active Direcotry user named ADUser in AWS Managed microsoft AD or Simple AD Directory
Reset-DSUserPassword -UserName ADuser -DirectoryId d-123456ijkl -NewPassword $Password-
For API details, see ResetUserPassword in AWS Tools for PowerShell Cmdlet Reference (V5).
-