共用方式為


Set-AzureADUserPassword

設定用戶的密碼。

語法

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

Description

Set-AzureADUserPassword Cmdlet 會設定 Azure Active Directory (AD) 中使用者的密碼。

範例

範例 1:設定用戶的密碼

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

此命令會設定指定的用戶密碼。

參數

-EnforceChangePasswordPolicy

如果設定為 true,請強制使用者變更其密碼

類型:Boolean
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ForceChangePasswordNextLogin

強制使用者在下次登入期間變更其密碼。

類型:Boolean
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ObjectId

指定物件的識別碼。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Password

指定密碼。

類型:SecureString
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False