How to create a new user mailbox in Exchange Online

This article compares the process of creating an Exchange Online mailbox using PowerShell and ADManager Plus, a unified Active Directory, Office 365 and Exchange management and reporting tool, and explains how the latter is the best option.

Windows PowerShell

To create Exchange Online mailbox using PowerShell,

  • Ensure you have the necessary permissions to perform the mailbox creation operation.
  • Get the values for all mandatory attributes such as MicrosoftOnlineServicesID.
  • Create the script with these values.
  • Execute the script in the PowerShell window.

A sample script to create Exchange Online mailbox using PowerShell

 Copied
New-Mailbox -Alias JohnS -Name JohnS -FirstName John -LastName Smith -DisplayName "John Smith" -MicrosoftOnlineServicesID johns@example.com -Password $password
Click to copy entire script

ADManager Plus

To create Exchange Online mailbox:

  • Select Single User Creation from User Management.
  • Select the appropriate User Creation Template, select Office 365, key in the values for all the required attributes, select the desired licenses, and click Create.

Screenshot

Create Exchange Online Mailbox for a User using ADManager Plus

» Start 30-day Free Trial

The script mentioned above will create an Exchange Online mailbox, and also an Office 365 user account without a license for John Smith using the new-mailbox cmdlet. Also when the script is executed, you will be prompted to enter the password. If you wish to use PowerShell to create shared mailbox in Exchange Online, you will have to depend only on the new-mailbox cmdlet.

Limitations of using PowerShell to create an Exchange Online mailbox.

  • You will not be able to create the mailbox unless you have the necessary permissions or privileges in Exchange Online. With ADManager Plus, users permissions in native AD or Exchange doesn't have to be elevated.
  • To bulk create mailboxes in Exchange from CSV, the script has to be modified, to include information such as the path or location of the CSV file. With ADManager Plus though, it is offered as a built-in option that's available by default.
  • The Office 365 user account is created without a license. An Office 365 license must be applied to the user account within 30 days from the time of account creation to activate the account. With ADManager Plus, Office 365 can also be applied to the user account right at the time of account creation.
  • If a user account already exists with the same Name and MicrosoftOnlineServicesID, there is no way to fix this dynamically, and the mailbox creation will fail. ADManager Plus proactively detects and avoid duplicates by using a different naming format, appending numbers and more.
  • To configure all the properties of the Exchange Online mailbox, the script has to be modified. With ADManger Plus, all properties can be configured at once.
  • There is no option to select a customized naming format. ADManager Plus allows you to create as many number of naming formats as needed.
  • You will have to be familiar with executing the scripts from the PowerShell window or command line. ADManager Plus is purely GUI-based, allowing you to perform all management and reporting actions with just mouse clicks from its web-based console.
  • Even a misplaced hyphen, a typo in the LDAP names or lack of sufficient permissions will lead to errors. As all actions in ADManager Plus are GUI-driven, there is no need to write scripts, eliminating the chances of errors, and they can be allowed to do this operation only in specific OUs or domains.

Simultaneously provision mailboxes in both Exchange and Office 365 with ADManager Plus.

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
     
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link