Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for equivalent command #1090

Closed
Tiberriver256 opened this issue Feb 15, 2022 · 2 comments
Closed

Searching for equivalent command #1090

Tiberriver256 opened this issue Feb 15, 2022 · 2 comments

Comments

@Tiberriver256
Copy link

I was directed here via this issue.

I am looking for the equivalent to this command here:

Set-MsolUserPassword -UserPrincipalName juser@techwizard.cloud -ForceChangePassword:$true

The typical use-case for this command is to force users to change their password the next time they log in. In widespread security incidents, it's even commonly referred to as a method for forcing all users to change their passwords. As explained in this blog post, there was unfortunately never an equivalent command created for the AzureAD PowerShell module.

With Azure AD Graph being disabled in June, I'm hoping to find an equivalent command in the newer supported modules.

@ghost ghost added the ToTriage label Feb 15, 2022
@ghost ghost added this to Issues to triage in Graph SDK - Triage Feb 15, 2022
@peombwa
Copy link
Member

peombwa commented Feb 22, 2022

@Tiberriver256, this can be done in Microsoft Graph by updating the PasswordProfile of a User. The command/API you are looking for is https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=powershell#example-3-update-the-passwordprofile-of-a-user-to-reset-their-password.

The Password property in the PasswordProfile is optional. Setting ForceChangePasswordNextSignIn to $true should be enough to trigger a reset from my testing:

Update-MgUser -UserId $UserId -PasswordProfile @{ ForceChangePasswordNextSignIn = $true }

@peombwa peombwa self-assigned this Feb 22, 2022
@ghost ghost removed the ToTriage label Feb 22, 2022
@peombwa peombwa removed this from Issues to triage in Graph SDK - Triage Feb 22, 2022
@peombwa peombwa added this to To do in Graph SDK - Powershell via automation Feb 22, 2022
@Tiberriver256
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants