David Haycox
asked on
How can we run a report of Exchange 2013 mailbox usage and quota?
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):
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
What command should I run to export this information to a file? Thanks in advance!
Get-Mailbox "a user"| Get-MailboxStatistics | Select DisplayName,TotalItemSize, TotalDelet edItemSize ,@{N="Issu eWarningQu ota";E={(G et-Mailbox $_).IssueWarningQuota}},@{ N="Prohibi tSendQuota ";E={(Get- Mailbox $_).prohibitsendquota}}
I used to use this, and it puts it in an excel spreadsheet for you.
Get-mailbox |Get-MailboxStatistics| select DisplayName,Database,Total ItemSize,I temCount,s toragelimi tstatus | export-csv C:\mailboxsizes.csv -NoTypeInformation
Get-mailbox |Get-MailboxStatistics| select DisplayName,Database,Total
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 {$_.UseDatabaseQuotaDefaul ts -eq $false} |
ft DisplayName,IssueWarningQu ota,Prohib itSendQuot a,@{label= "TotalItem Size(MB)"; expression ={(get-mai lboxstatis tics $_).TotalItemSize.Value.To MB()}}
And if you want to export it file then use below
get-mailbox -server <server> -ResultSize unlimited |
Where {$_.UseDatabaseQuotaDefaul ts -eq $false} |
ft DisplayName,IssueWarningQu ota,Prohib itSendQuot a,@{label= "TotalItem Size(MB)"; expression ={(get-mai lboxstatis tics $_).TotalItemSize.Value.To MB()}} > C:\file name.csv
if you want it for entire server then use below command.
get-mailbox -server <server> -ResultSize unlimited |
Where {$_.UseDatabaseQuotaDefaul
ft DisplayName,IssueWarningQu
And if you want to export it file then use below
get-mailbox -server <server> -ResultSize unlimited |
Where {$_.UseDatabaseQuotaDefaul
ft DisplayName,IssueWarningQu
ASKER
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:
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
But would prefer something like this:
DisplayName IssueWarningQuota(MB) ProhibitSendQuota(MB) TotalItemSize(MB)
----------- --------------------- --------------------- -----------------
Joe Bloggs 9728 10240 7013
Jane Doe Unlimited Unlimited 181
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}}
ASKER
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
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!
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()}}
ASKER
That's pretty much spot on, thanks! Finally, is it possible to export this into CSV for easy import into Excel?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect! Many thanks.