When changing a users username from @onmicrosoft.com to real domain you get the following error:
"We're sorry, the user couldn't be edited. Review the user information and try again. Correlation ID"
Or if creating a new user and you get the following error "A user with this name already exists. Use a different name."
But running the cmdlet as described in the following help article does not yield any results:
Best Answer
Probable cause:
There is a personal Microsoft account with the same email address, as the one you are trying to add, already present in the AD. This will NOT show up in the cmdlet output.
i.e. Adding mike@contoso.com (or changing the name from mike@contoso.onmicrosoft.com) will result in an error if Mike has already added his personal Microsoft account mike@contoso.com via the Azure Portal (this will show up in the list as mike_contoso.com#EXT#@contoso.onmicrosoft.com)
Solution: