Reset Office 365 User Password with PowerShell

Modified on Fri, 1 May at 6:11 PM


Connect-MgGraph -Scopes "User.ReadWrite.All", "Directory.AccessAsUser.All"

$UserId = "user@acmecorp.com"
$NewPassword = "theN3Wp@ssword"

$params = @{
    PasswordProfile = @{
        ForceChangePasswordNextSignIn = $true
        Password = $NewPassword
    }
}

Update-MgUser -UserId $UserId -BodyParameter $params

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article