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 "[email protected]" –NewPassword "...