Share via

Mail user bulk creation for AD users

Anonymous
2016-07-04T14:01:38+00:00

Hi,

I have an on-premise 2007 box and am running dirsync and ADFS.

I have bulk created users in AD without any exchange attributes except specified an email address in the ADUC email field.

I cannot find a way to make these new AD users have an online mailbox created AND be a Mail Enabled User for the GAL and group permissions etc.

Ideally I do not want to create a mailbox on premise, then migrate them, then make them a MEU.

What are my options to do this to bulk users? I know for a single user I can mess about with manual targetaddress and aliases etc. but what about 365 bulk user mailbox creation and also make them a MEU on-premise in bulk?

New to 365 admin so would appreciate any help

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-07-05T18:46:40+00:00

You cannot do this natively with the 2007 tools. Only way is by doing a Hybrid configuration and creating remote mailboxes.

If you need a script to automate this, just do a search on google/bing, there are lot of examples available. In a nutshell, you need to provision the on-prem user objects (for example, via New-ADUser), set their attributes accordingly (Set-ADUser), then force a dirsync. This part will depend on the tool you are using, for the latest AAD Connect version you can use something like:

Invoke-Command -ComputerName AADConnectServer -ScriptBlock { Start-ADSyncSyncCycle } 

You might want to put some delays in the script at that point, using the Start-Sleep cmdlet. 5 mins should be enough, but adjust it to match the size of your org.

Once the accounts are provisioned in O365, you need to set their Usage location and assign licenses. This is done via the WAAD PowerShell module and the Set-Msoluser and Set-MsolUserLicense cmdlets respectively.

If you need it as a bulk script, make sure it takes input from a CSV file or via the pipeline.

Was this answer helpful?

0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-03-20T11:30:12+00:00

    If you want to create Exchange mailboxes in bulk, there is no way you can do that with native tools. You can go for a PowerShell script if it's a one-time job, but if you want to do that automatically (e.g. after user creation or update), there are 3rd party solutions that provide that. Have a look at Adaxes, which does both Exchange and Office 365 automation that can be tied to AD.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-07-06T08:23:21+00:00

    Thanks. I looked for scripts to do this for hours and couldn't find any. Not being too hot with scripts I thought I could fudge someone else's together, but cannot find any that do what I want.

    It seems everyone either creates mailboxes and migrates them, then "Mail Enable User" them on-premise, or they have later exchange versions, or it's so simple that no one releases the script online!

    I know it can be done as a product called ADManager does this, but I can't get the source scripting for it from them obviously.   I just need a native script.

    Thanks for your help anyway

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-07-05T11:38:55+00:00

    Thanks for your reply.

    I can create the mailboxes online, the issue is then making them a mail enabled User (mail user) on -premise for the GAL and setting permissions (distribution lists) etc on-prem for dirsync to sync to online.

    What 'user objects on-prem' would I need to achieve this?

    "You can easily put all the steps in a script", ah.... well I can't easily put this in a script, hence my post here.  Bulk creation is the issue for me

    Any further help?

    Thanks

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-07-04T16:13:35+00:00

    The only way to create a mailbox directly in O365 is by using the New-RemoteMailbox cmdlet in a Hybrid configuration (or Enable-RemoteMailbox if the user object already exists).

    If you are not using Hybrid, simply provision the user objects on-prem, wait for dirsync (or force it), then license the user. You can easily put all the steps in a script, just make sure to put some pauses to accommodate for the sync delay.

    Was this answer helpful?

    0 comments No comments