Solved

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

Posted on 2015-01-12
7
5,727 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 17

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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In-place Upgrading Dirsync to Azure AD Connect
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
In this video we show how to create an Address List 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 Organization >> Ad…
This video discusses moving either the default database or any database to a new volume.

734 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