简体   繁体   中英

How to reset password for Azure AD account

I am trying to reset password of one Azure AD account by Set-AzureRMADUser cmdlets, but it throwing error "Set-AzureRmADUser : Property passwordProfile.password is invalid." COuld you please check? Below is the code.

Set-AzureRmADUser -UserPrincipalName XXXX -Password (ConvertTo-SecureString -String "XXXXX" -Force –AsPlainText)

Below is the complete error.

Set-AzureRmADUser : Property passwordProfile.password is invalid.
At line:1 char:1
+ Set-AzureRmADUser -UserPrincipalName admin@mit1openlinkcloud.onmicros        ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [Update-AzureRmADUser], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ActiveDirectory.UpdateAzureADUserCommand

You could try the command below.

Set-AzureADUserPassword -ObjectId <ObjectId> -Password <Password>

Refer to the link .

Update :

It may caused by your SecureString format, the password must meet the tenant's password complexity requirements. Refer to Password policy in Azure AD . You could refer to my specific command, it works fine.

$Password = ConvertTo-SecureString -String "P@ssW0rD!" -Force –AsPlainText
Set-AzureADUserPassword -ObjectId "ce336193xxxxxxxx" -Password $Password

在此处输入图片说明

Try to login to azure portal use the new password, it works fine.

在此处输入图片说明

Besides, I suppose the error of your command that you post may caused by it too, you could check it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM