官术网_书友最值得收藏!

Changing a user password

While it is typically best to allow a user to set their own password, there are times where an admin needs to take over and set a user's password on their behalf (for example, service accounts, terminated users, or a new user who is struggling to get their password properly set).

While it is a typical best practice to have a user immediately change their password once set, this recipe focuses on the admin setting the password and not forcing the user to reset the password upon the next login.

Getting ready

Using the skills learned in the Setting up the PowerShell environment recipe from Chapter 1, Office 365 Setup and Basic Administration, connect to your Office 365 tenant via PowerShell.

How to do it…

Enter the following command into your PowerShell or ISE window to change the password of a specific Office 365 user:

Set-MsOlUserPassword –UserPrincipalName "bertha@natechamberlain.com" –NewPassword "Password1" –ForceChangePassword $false

Should an admin wish to require a user to change the password upon next login, simply change the ForceChangePassword parameter's value of $false to $true.

How it works…

Instead of logging in to the Office 365 Admin center, an admin can quickly set a password through PowerShell and require whether a user resets that password upon next login or not.

主站蜘蛛池模板: 星座| 府谷县| 永宁县| 芜湖市| 体育| 金山区| 连州市| 项城市| 太湖县| 罗源县| 通道| 新郑市| 清徐县| 大埔区| 金乡县| 古浪县| 廊坊市| 上栗县| 株洲县| 武川县| 黔东| 松溪县| 涡阳县| 松潘县| 马鞍山市| 奉化市| 日喀则市| 什邡市| 拉孜县| 茂名市| 江华| 德兴市| 重庆市| 浙江省| 镶黄旗| 鹿泉市| 屏南县| 睢宁县| 海城市| 陕西省| 镇原县|