Set-​Azure​AD​User​Password

Sets the password of a user.

Syntax

Set-AzureADUserPassword
   [-EnforceChangePasswordPolicy <Boolean>]
   [-ForceChangePasswordNextLogin <Boolean>]
   -ObjectId <String>
   -Password <SecureString>
   [<CommonParameters>]

Description

The Set-AzureADUserPassword cmdlet sets the password for a user in Azure Active Directory (AD).

Examples

Example 1: Set a user's password

PS C:\>Set-AzureADUserPassword -ObjectId  "df19e8e6-2ad7-453e-87f5-037f6529ae16" -Password $password

This command sets the specified user's password.

Required Parameters

-ObjectId

Specifies the ID of an object.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-Password

Specifies the password.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-EnforceChangePasswordPolicy

If set to true, force the user to change their password

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-ForceChangePasswordNextLogin

Forces a user to change their password during their next log in.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False