Set-EntraSignedInUserPassword

更新已登录用户的密码。

语法

Default (默认值)

Set-EntraSignedInUserPassword

    -NewPassword <SecureString>
    -CurrentPassword <SecureString>
    [<CommonParameters>]

说明

Set-EntraSignedInUserPassword别名的 Update-EntraSignedInUserPassword cmdlet 更新Microsoft Entra ID中已登录用户的密码。

使用户能够更新自己的密码。 任何用户都可以更改其密码,而无需管理员权限。

示例

示例 1:更新密码

Connect-Entra -Scopes 'Directory.AccessAsUser.All'
$currentPassword = ConvertTo-SecureString '<strong-password>' -AsPlainText -Force
$newPassword = ConvertTo-SecureString '<strong-password>' -AsPlainText -Force
Set-EntraSignedInUserPassword -CurrentPassword $currentPassword -NewPassword $newPassword

此示例演示如何更新已登录用户的密码。

  • -CurrentPassword 参数指定已登录用户的当前密码。
  • -NewPassword 参数指定已登录用户的新密码。

参数

-CurrentPassword

指定已登录用户的当前密码。

参数属性

类型:SecureString
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-NewPassword

指定已登录用户的新密码。

参数属性

类型:SecureString
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

备注