Some problems only reveal themselves at scale. For instance, the get-msoluser commandlet only returns the first 1000 results, a problem that most 999...
Office 365 / Azure Active Directory Password Management
January 15, 2017
Office 365 poses some unique challenges for some of the simplest tasks. For instance, if you want to reset a user’s password using the Web UI you’ll find you cannot simply choose the new password without forcing the user to change it upon next login. Now I admit you can make a case for this being a good for security but there exists a handful of scenarios where this can become annoying.
Fortunately, using PowerShell you can easily set a new password for a user and tell Office 365 (or to be more precise, the Azure Active Directory controller that office 365 relies upon) not to force the user to change their password upon next login.
First we’ll need to connect PowerShell to your Office 365 tenant. If you are looking for a good guide on how to do this might I suggest this great guide to Connecting PowerShell to Office 365
Once you’re connected, simply substitute your desired username and password in for the bolded examples in the script below. I would get in the habit of always putting quotes around your passwords so that PowerShell does not try to parse any special characters your password may have.
And there you have it! Powershell will spit out your password back you to confirm the command was successful.
Suppose you’re reading this post because your password expired and you want to change it back to what it was originally AND prevent it form expiring again; The following command will tell Office 365 to disable password expiration for the specified user. Be sure to substitute your desired username for the bolded example.