PowerShell Set-Mailbox For Exchange 2010
Set-Mailbox is a handy PowerShell cmdlet for modifying an existing Exchange mailbox. When changing multiple mailboxes employ a second PowerShell cmdlet such as Get-Mailbox, then pipe its output into Set-Mailbox’s input.
- Getting Started with Set-Mailbox
- Example 1: Increase the Message Size Limits
- List PowerShell’s Set-Mailbox Parameters
- Example 2: Piping Input with Get-User
- Example 3: Set-Mailbox -Type
Before unleashing the power of any ‘Set-xyz’ cmdlets, I find it safer to check with the corresponding Get-xyz first. Another technique is to wade straight in with Set-Mailbox, but append the -WhatIf parameter until you are sure that the results are what you expected.
The only required parameter for Set-Mailbox is -Identity. As an alternative to the Exchange Alias, you could specify Distinguished name (DN) Domain\Account, User principal name (UPN), GUID, or the SmtpAddress; it makes no difference to Set-Mailbox’s -Identity parameter.
Set-Mailbox -Identity "GuyT" -MaxSendSize 5mb
Note 1a: While -Identity is the only mandatory parameter, it’s worth researching the other switches or parameters to improve your scripts.
Note 1b: Other interesting parameters include the ‘Archive’ family, e.g. ArchiveQuota and the Forwarding family e.g. ForwardingSmtpAddress.
Note 1c: Set-Mailbox -type accepts the following values:
One of the beauties of PowerShell is piping. In this case obtain a flow of ‘Managers’ using another cmdlet, and stream them into Set-Mailbox so that you can manipulate their properties.
Get-User -Filter "Title -eq ‘Managers’" | Set-Mailbox -MaxReceiveSize 20Mb
Note 2a: An alternative source cmdlet is Get-Mailbox, the piping techique would be the same as in the above script.
Manipulating another user’s mailbox is a responsible task. Thus before you execute the appropriate PowerShell 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
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.
- Bulk-import new users and mailboxes into Active Directory.
- Seek and zap unwanted user accounts.
- Find inactive computers.
Before you use a parameter such as -Type, I strongly recommend that you test with Get-Mailbox -Type, before you unleash a command that’s actually going to change this attribute.
Set-Mailbox -Type Room
Compare PowerShell with the EMC
- Launch the EMC, navigate to the Recipient Configuration Mailbox (see screenshot right)
Other Members of the PowerShell Mailbox Family of Cmdlets
As I have alread mentioned I would start with Get-Mailbox, but there are other similar PowerShell cmdlets, research thus:
Get-Command -noun Mailbox
More Examples of Mailbox Cmdlets
Try this: Get-Command -noun Mailbox*
You should find Get-MailboxServer and Get-MailboxDatabase.
I like thePermissions Monitor because it enables me to see quickly WHO has permissions to do WHAT. When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, takes into account network share access, then displays the results in a nifty desktop dashboard!
Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for users access to a resource. Give this permissions monitor a try – it’s free!
Summary of PowerShell Set-Mailbox
Set-Mailbox is the best cmdlet for modifying an existing Exchange mailbox. For changing multiple mailboxes employ a second PowerShell cmdlet such as Get-User, then pipe its output into Set-Mailbox.
If you like this page then please share it with your friends