PowerShell Enable-Mailbox For Exchange 2010
With Enable-Mailbox what you see is what you get. One popular scenario for this PowerShell cmdlet is you have already created an active directory user account, and you are at the point where you want to add the mailbox. The result of Enable-Mailbox is the user can now send and receive email.
Topics for Exchange 2010 Enable Mailbox
- Example 1: Enable-Mailbox -Identity
- Example 2: Enable-Mailbox -Database
- List the Enable-Mailbox Parameters
- Where Next with Enable-Mailbox?
♣
Getting Started with Enable-Mailbox
As we will see later, Enable-Mailbox has a surprising number of parameters; thus all the more reason to start with a simple example.
Example 1: Enable-Mailbox -Identity
# Exchange 2010 Enable Mailbox with PowerShell
Enable-Mailbox -Identity "Guy Thomas" -Database DB01
Note 1a: "Guy Thomas" must already exist as an active directory user.
Note 1b: Although -Identity is a required parameter you could use the corresponding Domain\Account instead of "Guy Thomas"
Example 2: Enable-Mailbox -Database
#Exchange 2010 PowerShell Script
Enable-Mailbox -Identity "Guy Thomas" -Database DB01
While you don’t need to use the -Database parameter, I always use it where there is more than one Exchange Mailstore.
List the Enable-Mailbox Parameters
Extend your scripting capabilities by getting to know more parameters:
Get-Help Enable-Mailbox
Most of the extra parameters cater for the more exotic classes of mailbox, Room \ Equipment, Arbitration (Workflow), and Archive. See more on PowerShell 3 workflow.
Two parameters that warrant further attention are: -Force if you are running a script and don’t want administrator intervention. And -WhatIf for testing your PowerShell command before you commit.
Guy Recommends: SolarWinds’ Free Bulk Mailbox Import Tool
Import users from a spreadsheet, complete with their mailbox. Just provide a list of the users with the fields in the top row, and save as .csv file. Then launch this FREE utility, match your Exchange fields with AD’s attributes, click and import the users. Optionally, you can provide the name of the OU where the new mailboxes will be born.
There are also two bonus tools in the free download, and all 3 have been approved by Microsoft:
- Bulk-import new users and mailboxes into Active Directory.
- Seek and zap unwanted user accounts.
- Find inactive computers.
Download your FREE bulk mailbox import tool.
Where Next with Enable-Mailbox?
Pipelining is one of PowerShell’s best features. A classic scenario is where you already have a script such as import mailboxes; then you can the pipe the output into Enable-Mailbox, as a result the imported users can send email.
Import-Mailbox -Identity "Guy Thomas -PSTFolderPath C:\PSTFiles\GuyT.csv | Enable-Mailbox
Note 2a: The tiny (|) controls the pipeline.
Note 2b: To test this piping idea you could try:
Get-User -Identity | Enable-Mailbox.
Here is a more fulsome example:
Get-User -OrganizationalUnit Sales | Where-Object [$_.Recipient Type -eq "User"} | Enable-Mailbox -Database "DBSales"
See more about Enable-Mailbox.
Exchange 2010 Permissions
If you think about it, being able to connect a mailbox is a responsible task. Thus before you execute the appropriate PowerShell script you must be a member of these exchange groups:
- ‘Organization Management role group’
- ‘Server Management management role group’
Management management is not a typo!
Instead of the EMC try this PowerShell command:
New-ManagementRoleAssignment -Role "Organization Management role" -User YourName
Compare PowerShell with the EMC
From a learning point-of-view it it’s worth a walk-through in the Exchange Management Console (EMC), the benefit is you can compare the PowerShell mailbox script with what you see in the Exchange GUI.
- Launch the EMC, navigate to the Recipient Configuration, Mailbox (see screenshot right.)
Other Members of the Mailbox Family of Cmdlets
Get-Command -noun Mailbox
More Examples of Mailbox Cmdlets
- Disable-Mailbox
- Export-Mailbox
- Get-Mailbox
- Import-Mailbox
- Move-Mailbox
- New-Mailbox
- Move-Mailbox
- Remove-Mailbox
- Restore-Mailbox
- Search-Mailbox
- Set-Mailbox
Note 3: There is also Enable-MailboxStatistics
Try this: Get-Command -noun Mailbox*
Note 4: See more on PowerShell’s Enable-Mailbox.
Guy Recommends: The SolarWinds Exchange Monitor
Here is a free tool to monitor your Exchange Server. Download and install the utility, then inspect your mail queues, monitor the Exchange server’s memory, confirm there is enough disk space, and check the CPU utilization.
This is the real deal – there is no catch. SolarWinds provides this fully-functioning freebie, as part of their commitment to supporting the network management community.
Free Download of SolarWinds Exchange Monitor
Summary of Exchange 2010 Enable-Mailbox PowerShell Cmdlet
The most common scenario for this PowerShell cmdlet is you have already created an active directory user account, and you are at the point where you want to add the mailbox. By employing Enable-Mailbox the user can now see their email.
If you like this page then please share it with your friends
See more PowerShell Cmdlets for Exchange 2010:
• Exchange 2010 Home • Enable-Mailbox • Disable-Mailbox • New-Mailbox • Set-Mailbox
• Get-Mailbox • Get-MailboxStatistics • Connect-Mailbox • Export-Mailbox • Import-Mailbox
• Exchange 2010 PowerShell commands • Get-ExchangeServer • Get-MailboxDatabase
Please write in if you see errors of any kind. Please report any factual mistakes, grammatical errors or broken links, I will be happy to not only to correct the fault, but also to give you credit.