Edit

Share via


Set-AzureADUserPassword

Sets the password of a user.

Syntax

Default (Default)

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  "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb" -Password $password

This command sets the specified user's password.

Parameters

-EnforceChangePasswordPolicy

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

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-ForceChangePasswordNextLogin

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

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-ObjectId

Specifies the ID of an object.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Password

Specifies the password.

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.