Remove one of two .onmicrosoft.com aliases?

A user have two .onmicrosoft.com aliases and I would like to remove one of them. Is that possible?
I think I have managed to do it before, but I am not sure.

Set-MsolDirSyncEnabled -EnableDirSync $false

Waited some Hours then...

Set-Mailbox asdasd.asdas@asdaasdasd.com -EmailAddresses @{remove="yyxyxc@erwercvcv.onmicrosoft.com "}
"WARNING: The command completed successfully but no settings of '<user name>' have been modified."

It was not possible to remove this onmicrosoft.com address?
greenshootsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sajid Shaik MSystem AdminCommented:
w.jpgOFFICE 365 ADMIN contolpanel users search user properties.. select the user and delete the alias..

all the best
Shreedhar EtteTechnical ManagerCommented:
Go to Exchange Admin Console and open the User Properties to be modified then remove the onmicrosoft.com email address.
Adam the 32-bit AardvarkSoftware DeveloperCommented:
@greenshoots the cmdlet you have used seems absolutely fine. The most probable cause for its failure is the additional space at the end (@{remove="yyxyxc@erwercvcv.onmicrosoft.com "}) or an accidental typo. Try the cmdlet without the space and if it still does not work, run
get-mailbox {mailbox identity}| select -ExpandProperty emailaddresses

Open in new window

to verify if the address is the same.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
greenshootsAuthor Commented:
I'll check that out. It's possible that it is the space at the end 😅. Have to wait for sync to stop.
greenshootsAuthor Commented:
It worked.

@Adam the 32-bit Aardvark
I can confirm that it worked with PowerShell. It was the space. 😁

I guess it also worked with the Web Gui.

Thank you so much for helping.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.