Sysadminsblog.com Anything for sysadmins!

12Dec/120

Mailbox size overview for Exchange 2010

Once every now and then you'll want an overview of what the mailbox sizes are for your organization. You can then see who is using the most space and perhaps offer them some help archiving their mailbox. However Exchange 2010 doesn't really offer this in a organized way. This is exactly the reason why I created this one-liner. This will output to a GridView or to a CSV which you can then use to organize the data as you wish.

Get-MailboxDatabase | % { Get-MailboxStatistics -Database $_.Name | Select DisplayName, @{Name="Size (MB)";Expression={($_.TotalItemSize).Substring($a.IndexOf("(")).Replace("(","").Replace(" bytes)","").Replace(",","") / 1MB}} }

You could output it to GridView by piping it to

Out-GridView

Get-MailboxDatabase | % { Get-MailboxStatistics -Database $_.Name | Select DisplayName, @{Name="Size (MB)";Expression={($_.TotalItemSize).Substring($a.IndexOf("(")).Replace("(","").Replace(" bytes)","").Replace(",","") / 1MB}} } | Out-GridView

Or export it to a CSV by piping it to

Export-CSV

:

 Get-MailboxDatabase | % { Get-MailboxStatistics -Database $_.Name | Select DisplayName, @{Name="Size (MB)";Expression={($_.TotalItemSize).Substring($a.IndexOf("(")).Replace("(","").Replace(" bytes)","").Replace(",","") / 1MB}} } | Export-Csv C:\MailboxSizes.csv

As a result you can open the CSV in Excel, add some Conditional Formatting and Column Formating and voila! Yes, these are the actual mailbox sizes!

7Dec/123

PST Capture errors

I'm currently in the process of configuring PST Capture in order to migrate all the user's PST files to the recently configured cloud based Online Archive. As this wasn't working properly, I contacted Microsoft and opened a support ticket. I'm getting the error "Import error: Error opening mailbox <mail address>" when I try to import the PST file into my Online Archive. During the troubleshooting of this error I came across a nice list of requirements for the PST Capture tool to function properly. This might help you to configure everything correctly.

  1. Please make sure that you have the 64 Bit version of Outlook installed and that it is installed on the machine on which PST Capture Tool is running.
  2. Please check if the user has the Mailbox Import Export permissions. If it does not have them, then please assign them using the following command:
    </em>New-ManagementRoleAssignment -Role "Mailbox Import Export" -User "PSTImportUser"
  3. Please check that the Microsoft Exchange PST Capture Tool's Service Account has an Exchange 2010 Mailbox.
  4. Please check that the PST Capture Tool's Service Account is a member of Local Administrators Group.
  5. Please make sure that the PST Capture Tool's Service Account is a member of Organization Management and also the Public Folder Management.
  6. Check that the Service Account is mailbox-enabled and has an Outlook profile configured for it.
  7. Please make sure that the correct Service Account is chosen for the PST Capture Tool. To do this, please go to Properties of 'Microsoft Exchange PST Capture Service' > Log on tab  and check the Service Account.

 

Please comment below if you have questions about the PST Capture tool, or the above settings.