Link to home
Start Free TrialLog in
Avatar of Shannon Mollenhauer
Shannon MollenhauerFlag for United States of America

asked on

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!
Avatar of timgreen7077
timgreen7077

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.
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
Avatar of Shannon Mollenhauer

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Shannon Mollenhauer
Shannon Mollenhauer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Turns out the command was Set-User to change the user name.