"A user with this name could not be found" error message when you try to reset a password for a user in Office 365

PROBLEM
When you try to reset a password for a user in Microsoft Office 365, you receive the following message:
A user with this name could not be found. They may have been deleted.
SOLUTION
To resolve this issue, use Microsoft Azure Active Directory Module for Windows PowerShell to set the user principal name (UPN) to the default domain. Then, change the user principal name back to use the vanity domain. To do this, follow these steps: 
  1. Start Azure Active Directory Module for Windows PowerShell, and connect to Azure Active Directory. 

    Note For more info about Azure Active Directory Module for Windows PowerShell, go to the following Microsoft website: 
  2. Change the UPN of the user to the default domain. To do this, run the following command:
    Set-MsolUserPrincipalName -UserPrincipalName [ExistingUPN] -NewUserPrincipalName [NewUPN]
    For example, use this command:
    Set-MsolUserPrincipalName -UserPrincipalName johnsmith@contoso.com -NewUserPrincipalName johnsmith@contoso.onmicrosoft.com
  3. Change the UPN of the user back to the original domain. To do this, run the following command:
    Set-MsolUserPrincipalName -UserPrincipalName [ExistingUPN] -NewUserPrincipalName [NewUPN]
    For example, use this command:
    Set-MsolUserPrincipalName -UserPrincipalName johnsmith@contoso.onmicrosoft.com -NewUserPrincipalName johnsmith@contoso.com
  4. Reset the password again.

Still need help? Go to the Office 365 Community website.
Properties

Article ID: 2621753 - Last Review: 05/18/2016 05:37:00 - Revision: 20.0

Microsoft Office 365, Office 365 User and Domain Management

  • o365 o365a o365e o365m o365022013 o365p KB2621753
Feedback