Solved

How can we run a report of Exchange 2013 mailbox usage and quota?

Posted on 2014-07-24
10
2,122 Views
Last Modified: 2014-07-31
We are running Exchange 2013.  We need to run a regular report that lists the following information:

Display Name
Mailbox size in MB
Deleted items in MB
Warning Quota in MB
Prohibit Send Quota in MB

I have experimented with various Exchange shell commands but cannot find one command that lists all this information; I have to run two and combine the results later.  Ideally the results would look something like this (in .txt or .csv format):

DisplayName     TotalItemSizeinMB TotalDeletedItemSize(MB) IssueWarningQuota ProhibitSendQuota                          
-----------     ----------------- ------------------------ ----------------- -----------------
Joe Bloggs                   6984                    59.39              9728             10240
Jane Doe                      159                     6.03         Unlimited         Unlimited

Open in new window

What command should I run to export this information to a file?  Thanks in advance!
0
Comment
Question by:David Haycox
10 Comments
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 40217180
Get-Mailbox "a user"| Get-MailboxStatistics | Select DisplayName,TotalItemSize,TotalDeletedItemSize,@{N="IssueWarningQuota";E={(Get-Mailbox $_).IssueWarningQuota}},@{N="ProhibitSendQuota";E={(Get-Mailbox $_).prohibitsendquota}}
0
 
LVL 7

Expert Comment

by:tolinrome
ID: 40217287
I used to use this, and it puts it in an excel spreadsheet for you.

Get-mailbox |Get-MailboxStatistics| select DisplayName,Database,TotalItemSize,ItemCount,storagelimitstatus | export-csv C:\mailboxsizes.csv -NoTypeInformation
0
 
LVL 4

Expert Comment

by:Satish Auti
ID: 40217300
that one is only for single user.

if you want it for entire server then use below command.

get-mailbox -server <server> -ResultSize unlimited |
 Where {$_.UseDatabaseQuotaDefaults -eq $false} |
   ft DisplayName,IssueWarningQuota,ProhibitSendQuota,@{label="TotalItemSize(MB)";expression={(get-mailboxstatistics $_).TotalItemSize.Value.ToMB()}}

And if you want to export it file then use below

get-mailbox -server <server> -ResultSize unlimited |
 Where {$_.UseDatabaseQuotaDefaults -eq $false} |
   ft DisplayName,IssueWarningQuota,ProhibitSendQuota,@{label="TotalItemSize(MB)";expression={(get-mailboxstatistics $_).TotalItemSize.Value.ToMB()}} > C:\file name.csv
0
 
LVL 1

Author Comment

by:David Haycox
ID: 40226745
Justin Yeung: if I remove the "a user" from the command, this gives the right information, but not in the table format we want.

tolinrome: your command gives output in the required tabular format but doesn't display anything for quota (the "StorageLimitStatus" column is blank.

Satish Auti: if I remove the "-server" section (or specify it), this gives the correct information in columns, but only for users who are not set to use the database quota defaults.  If I miss out the "where" section though, this will display all mailboxes.

So we're nearly there - but can the output be formatted to use the same unit (MB or GB) for all columns, to make it easier to read?  For example, currently we are getting this:
DisplayName                   IssueWarningQuota             ProhibitSendQuota             TotalItemSize(MB)
-----------                   -----------------             -----------------             -----------------
Joe Bloggs                    9.5 GB (10,200,547,328 bytes) 10 GB (10,737,418,240 bytes)  7013
Jane Doe                      Unlimited                     Unlimited                     181

Open in new window

But would prefer something like this:
DisplayName                   IssueWarningQuota(MB)         ProhibitSendQuota(MB)         TotalItemSize(MB)
-----------                   ---------------------         ---------------------         -----------------
Joe Bloggs                    9728                          10240			  7013
Jane Doe                      Unlimited                     Unlimited                     181

Open in new window

0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 40227258
Get-Mailbox | Get-MailboxStatistics | ft DisplayName,@{N="Total Item Size (MB)";E={$_.TotalItemSize.value.tomb()}},@{N="Total Deleted Item Size (MB)";E={$_.TotalDeletedItemSize.value.tomb()}},@{N="IssueWarningQuota";E={(Get-Mailbox $_).IssueWarningQuota}},@{N="ProhibitSendQuota";E={(Get-Mailbox $_).prohibitsendquota}} 

Open in new window

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:David Haycox
ID: 40228605
That gives us the total deleted item size in MB, but the quota columns are listed in GB and bytes, like so:
DisplayName                Total Item Size (MB)     Total Deleted Item  IssueWarningQuota       ProhibitSendQuota
                                                              Size (MB)
-----------                -------------------- ----------------------- -----------------       -----------------
Joe Bloggs                                 7006                      23 9.5 GB (10,200,547,3... 10 GB (10,737,418,24...
Jane Doe                                    182                       7 Unlimited               Unlimited

Open in new window

I know it's easy enough to compare e.g. 7006MB with 10GB, but if it's possible to get all figures in either MB or GB (or bytes, for that matter) then that would be the ideal solution for us.  Thanks!
0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 40229262
Try this.

Get-Mailbox | Get-MailboxStatistics | ft DisplayName,@{N="Total Item Size (MB)";E={$_.TotalItemSize.value.tomb()}},@{N="Total Deleted Item Size (MB)";E={$_.TotalDeletedItemSize.value.tomb()}},@{N="IssueWarningQuota (MB)";E={(Get-Mailbox $_).IssueWarningQuota.Value.toMB()}},@{N="ProhibitSendQuota (MB)";E={(Get-Mailbox $_).prohibitsendquota.Value.ToMB()}} 

Open in new window

0
 
LVL 1

Author Comment

by:David Haycox
ID: 40229327
That's pretty much spot on, thanks!  Finally, is it possible to export this into CSV for easy import into Excel?
0
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 500 total points
ID: 40229343
if you want to export it, you will need to change "ft" to select
Get-Mailbox | Get-MailboxStatistics | Select DisplayName,@{N="Total Item Size (MB)";E={$_.TotalItemSize.value.tomb()}},@{N="Total Deleted Item Size (MB)";E={$_.TotalDeletedItemSize.value.tomb()}},@{N="IssueWarningQuota (MB)";E={(Get-Mailbox $_).IssueWarningQuota.Value.toMB()}},@{N="ProhibitSendQuota (MB)";E={(Get-Mailbox $_).prohibitsendquota.Value.ToMB()}} | export-csv "c:\export\exchangecsv.csv" -NoTypeInformation

Open in new window

0
 
LVL 1

Author Comment

by:David Haycox
ID: 40231217
Perfect!  Many thanks.
0

Featured Post

Can’t get the mobile email signature right?

Not having any luck when trying to create an email signature for mobile devices? Does the formatting keep messing up? Make sure you have great email signatures on all devices by using Exclaimer Cloud - Signatures for Office 365.

Question has a verified solution.

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

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a User Mailbox 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 Recipients >> Mailb…
In this video we show how to create a mailbox database 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 Servers >> Data…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now