Request password change at next Microsoft 365 login

Sometimes we come across entire domains with standardized passwords for all users, in addition to being totally insecure, it involves other governance problems.

Make the user change the password at the next login, through the graphical interface, there are two ways:

1 – Configure passwords to expire in a certain period of time, and wait for this period to arrive.

2 – Change to new passwords prompting change at next login.

Read more:

Brute force attack: what is it, how does it work and how to avoid it?
How to fix the trust relationship between the workstation and the AD domain
How to find inactive computers and users in AD with Powershell
MFA, do you know what it is?
How to forward in Exchange Online to more than one Mailbox

Particularly, the first option is not very functional for this purpose, see that it is only for this purpose, that we need to change it quickly, this option must be enabled so that users periodically change their passwords.

In the second option, the impact is very large, we will have to change passwords and inform users.

The way I usually do it, and in particular I prefer, is to run a script that requests the change of the next login without changing the user's current password, in this case we can execute the following codes:

Force a user to change password at next login:

Set-MsolUserPassword -UserPrincipalName [email protected] -ForceChangePasswordOnly $true -ForceChangePassword $true

Force all domain users to change password at next login:

Get-MsolUser -All | Set-MsolUserPassword -ForceChangePasswordOnly $true -ForceChangePassword $true

Force a domain user group to change the password at the next login using the Country parameter:

Get-MsolUser -All | ? {$_.Country -eq "BR"} | Set-MsolUserPassword -ForceChangePasswordOnly $true -ForceChangePassword $true

In this command you can change the parameter “Country” to “Department”, for example, and only change the passwords for a certain sector.

Was this article helpful?

To maintain a quality standard for you, we have invested in a great hosting plan, Paid CDN, Website Optimization Plugins, etc ...

Help us to keep the project active! 

Follow the news in real time. Follow our Instagram profile..

natacavalcante
I have a bachelor's degree in Information Systems from SENAC, graduated in IT technician and always studying new technologies and methodologies that can make me stand out as a professional. For more than 10 years working in the IT market, I am a professional looking for knowledge in technology and entrepreneurship, since in this field the information becomes obsolete quickly and the continuous search for information helps us every day to become competent professionals and better people. I have had the opportunity to work from small companies to multinationals, currently I am an entrepreneur and I dedicate to this brief journey in the job market the idea of undertaking in this field and today I dedicate my time taking care of my company's clients, offering new technologies so that IT is aligned with my client's business rule.
en_USEnglish

UP TO 90% DISCOUNT

TAKE OFF YOUR CAREER !!

Do you want to upgrade your career? 

Invest in yourself and get ahead! Get that dream job in 2022!