What's the PowerShell syntax to change a mailbox name in Office 365?

I have an Office 365 Business Premium user who somehow ended up with the name "Office" and alias of "Jane". It might have happened when the accounts were first provisioned a few years ago and the name Office was one of her aliases since she was the office manager.

Now, however, we'd like to have a shared mailbox called Office that more than one person can manage and receive messages in. Trying to use the GUI to create the shared mailbox gives the error that the name is already in use. When I ran the "Get-mailbox" command, I found that Jane was actually listed as the alias value for the name "Office" instead of the other way around. I've gone through the additional email addresses and made sure Office@company.com was not assigned to her any more, but the Name appears to be a value I can't change from the GUI.

My problem is trying to figure out the "Set-mailbox" command I need to run to change Office to Jane. I imagine it's a pretty simple command, but I'm not experienced enough with PS to untangle the syntax. How do I change mailbox name "Office" to "Jane"?

Your help is greatly appreciated!
Shannon MollenhauerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

timgreen7077Exchange EngineerCommented:
Why not just log into o365 and change it? Log into O365 and open the exchange admin center. Click recipients > mailboxes, select the mailbox you want to edit the alias on and click the pencil icon to edit it. A new window will open and the first option tab is 'general' and its there you will see the user information along with the alias that you can change. you can do this for the user mailbox and the shared mailbox.
Aaron GuilmetteTechnology Solutions ProfessionalCommented:
If the current mailbox's alias is Jane and you want to change it to Office, from PowerShell connected to Exchange Online:

Set-Mailbox -Identity Jane -Alias Office
Shannon MollenhauerAuthor Commented:
As I stated in the original post, I can't make this kind of change from the GUI in Exchange admin center.

I have to perform some kind of command that says "change the name of mailbox 'office' to 'jane' " because the GUI is showing the user's real name, "Jane Doe" in the display name and her email address as "Jane@company.com" (along with some others, like jdoe@company.com). When I run the Get-Mailbox command, I get a list of Name and Alias values which include 'office' for the name and 'jane' as the alias. Other users have a name like BSmith and alias Bob. Her name should NOT be Office - HOW DO I CHANGE HER MAILBOX NAME IN POWERSHELL?
Shannon MollenhauerAuthor Commented:
Someone on Spiceworks gave me the right answer:
I ran "set-user -identity office -name jane" and was able to change it. Then I could use the GUI to create the shared mailbox.

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
Shannon MollenhauerAuthor Commented:
Turns out the command was Set-User to change the user name.
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
Microsoft Office

From novice to tech pro — start learning today.