Remove one of two .onmicrosoft.com aliases?

greenshoots
greenshoots used Ask the Experts™
on
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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
w.jpgOFFICE 365 ADMIN contolpanel users search user properties.. select the user and delete the alias..

all the best
Shreedhar EtteTechnical Manager
Top Expert 2010

Commented:
Go to Exchange Admin Console and open the User Properties to be modified then remove the onmicrosoft.com email address.
@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.

Author

Commented:
I'll check that out. It's possible that it is the space at the end 😅. Have to wait for sync to stop.

Author

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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial