Share via

Bulk Create Mail Users

Anonymous
2016-11-08T11:51:02+00:00

My company has several hundred alias that need to be created that forward out to another mail system.  I know I can create full mailboxes in bulk via the interface on O365 but there's no option to bulk create mail users in the Exchange admin center. 

Is there a way to complete this via a CSV file and powershell commands?

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-11-08T15:09:53+00:00

Hi Rob,

Based on my test, you can bulk create mail users in Office 365 referring to these steps:

  1. Create a new .csv file with these columns included and add the corresponding mail users’ information:

Name    ExternalEmailAddress    MicrosoftOnlineServicesID    Password

  1. Connect to Exchange Online PowerShell
  2. Run this script to import the .csv file:

$users = Import-Csv (folder path of the .csv file)

$users | ForEach-Object {

New-MailUser -Name $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -MicrosoftOnlineServicesID $_.MicrosoftOnlineServicesID -Password (ConvertTo-SecureString -String '$_.Password' -AsPlainText -Force)}

NOTE: You should replace (folder path of the .csv file) with the real folder path value.

If you encounter any errors running the cmdlets above, please feel free to take a relevant screenshot of the error message and upload it for our further analysis.

Regards,

Sam

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-11-08T18:24:54+00:00

    Hi Rob,

    No. Please follow the Sam's suggestion and use those columns listed above ( Name    ExternalEmailAddress    MicrosoftOnlineServicesID    Password)to create the .csv file. 

    If you encounter any issues or errors during the process, please capture a relevant screenshot of the scenario for further troubleshooting.

    Thanks,

    Lance

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-11-08T19:15:28+00:00

    Everything worked in my test environment, thank you very much!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-11-08T17:53:37+00:00

    Thanks for the quick response, I'll not be able to test right now but will by this time tomorrow.  Is there a specific format for the CSV file?

    Was this answer helpful?

    0 comments No comments