Set-AzureADUserPassword

Sets the password of a user.

Syntax

Set-AzureADUserPassword
   -ObjectId <String>
   -Password <SecureString>
   [-ForceChangePasswordNextLogin <Boolean>]
   [-EnforceChangePasswordPolicy <Boolean>]
   [<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.

Parameters

-EnforceChangePasswordPolicy

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

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ForceChangePasswordNextLogin

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

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ObjectId

Specifies the ID of an object.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Password

Specifies the password.

Type:SecureString
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False