Solved

How do you create mailboxes for an existing users in Exchange 2013?

Posted on 2015-01-12
7
4,172 Views
Last Modified: 2015-01-28
How do you create mailboxes for an existing users in Exchange 2013? From what I can see, with exchange admin center (EAC) you can’t select more than one existing user in Active Directory. Well, I don't really want to do it one by one for the 130 users. In Exchange 2007 it was very easy task to do inside the exchange management console.
I need a bit of help with the Exchange 2013 PowerShell command to create (enable) mailboxes for the existing users in OU. Keep in mind that some users in OU already have mailboxes enabled and some don’t. Mailboxes for all users in OU will be created on the same Exchange database.
Thanks in advance
0
Comment
Question by:Olevo
7 Comments
 
LVL 16

Expert Comment

by:Emmanuel Adebayo
ID: 40544082
Hi,

You can use the Enable-Mailbox See the usage below

Enable-Mailbox -Identity Domain\username -Database <Exchange>

This will create a mailbox for the existing username. The mailbox is created in Exchange.
Regards
0
 
LVL 63

Accepted Solution

by:
Simon Butler (Sembee) earned 500 total points
ID: 40544087
This should work for you:
get-user -OrganizationalUnit "Staff OU" | enable-mailbox -database "Mailbox Database 4"  

Change the OU to match the name of the OU you want to enable, and the database to match the database you want to use.

It only works for OUs, so "Users" which is built in to ADUC doesn't work. If the OU is nested then you will probably have to do the complete path.

Users in the OU who are already mailbox enabled will throw an error.

Simon.
0
 
LVL 9

Expert Comment

by:schmiegu
ID: 40544319
Try this:
Get-ADUser -Searchbase 'OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM' -Filter "*" -Properties * | Where {!($_.HomeMDB)} | Enable-Mailbox -Database "ABC"

I search an OU (and Sub-OUs) for all users, then apply a filter to the users, that don't have a mailbox database and then I enable the mailbox. Instead of enabling the mailbox you may want to display the results: Ommit the last pipe or use e.g. "ft DistinguishedName"

BTW: I don't know a cmdlet "Get-User"
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:Olevo
ID: 40545921
Thanks schmiegu, your solution is exactly what I want, however...
Before I'm going to enable mailboxes for the existing AD users in OU I would like to know which user doesn't have mailbox in  Exchange 2013 Server.
Running following powershell command in Exchange console:
Get-ADUser -Searchbase 'OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM' -Filter "*" -Properties * | Where {!($_.HomeMDB)}
... shows all users in OU (with and without mailbox in Exchange server) and all of them have 'HomeMDB' field empty?!  Perhaps we need to filter by different field...
0
 
LVL 9

Expert Comment

by:schmiegu
ID: 40546028
This command shows only the users, that don't have a mailbox. They don't even have the property HomeMDB - they get this (and a lot of others) with enable-mailbox. To see the users with mailboxes, the where clause would read: Where {$_.homeMDB}.
To see the different properties you can use:
Get-ADUser MailEnabledUser -Properties * | gm 

Open in new window

or
Get-ADUser NotMailEnabledUser -Properties * | gm

Open in new window

You can filter on any of the properties, a not mail enabled user doesn't have. HomeMDB is one of them - and I'm used to use this property for filtering.
0
 
LVL 1

Author Comment

by:Olevo
ID: 40548076
Sorry schmiegu but your proposed powershell command just don’t work for me ;-( Perhaps, something else needs to be added or removed from the command?!

Get-ADUser -SearchBase 'OU=Staff,DC=FABRIKAM,DC=COM' -Filter "*" -Properties * | where {!($_.homeMDB)} | Enable-Mailbox -Database “Staff”
~~~Error~~~
The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
    + CategoryInfo          : InvalidArgument: (CN=Kate Smith,OU...ff,DC=COM:PSObject) [Enable-Mailbox], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Enable-Mailbox
    + PSComputerName        : ex2013srv.fabrikam.com
~~~

Anyway, looks like Simon Butler (Sembee) was on a right track here. Here is the PowerShell command I have used and all works fine for me.

Get-User -OrganizationalUnit "Staff" -RecipientTypeDetails User | Enable-Mailbox -Database Staff

FYI: Here is some info from :
Microsoft Exchange Server 2013 PowerShell Cookbook (Second Edition) by Jonas Andersson and Mike Pfeiffer
Chapter 3: Managing Recipients (Page 88-89)
===
The only requirement when running the Enable-Mailbox cmdlet is that you provide the identity of the Active Directory user that should be mailbox-enabled. In the previous example, we've specified the database in which the mailbox should be created, but this is optional. The Enable-Mailbox cmdlet supports a number of other parameters that you can use to control the initial settings for the mailbox.

You can use a simple one-liner to create mailboxes in bulk for existing Active Directory users:

Get-User -RecipientTypeDetails User |Enable-Mailbox -Database DAGDB1

Notice that we've run the Get-User cmdlet specifying User as the value for the -RecipientTypeDetails parameter. This will retrieve only the accounts in Active Directory that have not been mailbox-enabled. We then pipe those objects down to the Enable-Mailbox cmdlet and mailboxes are created for each of those users in one simple operation.
===
0
 
LVL 9

Expert Comment

by:schmiegu
ID: 40548462
Now I've found the get-user cmdlet (the exchange management snap-in is needed, which I have not installed on my workstation).
It seems, the -Identity param of enable mailbox doesn't accept distinguished names, so maybe an additional pipe (| select  UserPrincipalName) would solve the problem (according to the enable-mailbox help examples Identity shoul accept UPNs and Domain\user).

But Get-User is the way to go.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now