Problem
You want to get and modify information about mailboxes from the Exchange Management Shell.
Solution
To retrieve information about a mailbox (or multiple mailboxes), use the GetMailbox cmdlet:
$user = GetMailbox *preeda*
$user | FormatList * To modify information about a mailbox, use the SetMailbox cmdlet. This example prevents Preeda from sending mail when her mailbox goes over 2 GB, and then verifies it:
$user | SetMailbox –ProhibitSendQuota 2GB $user | GetMailbox
Discussion
In addition to the common task of retrieving and modifying mailbox information, another useful mailboxrelated command is the MoveMailbox cmdlet. For example, to move all users from one storage group to another database:
GetMailbox |
WhereObject { $_.Database –like "*SMBEX01\First Storage Group" } |
MoveMailbox –TargetDatabase "Mailbox Database 3"
After a few moments, that command displays the progress of the bulk mailbox move.
For more information about the GetMailbox cmdlet, type GetHelp GetMailbox. For more information about the SetMailbox cmdlet, type GetHelp SetMailbox. For more information about the MoveMailbox cmdlet, type GetHelp MoveMailbox.