Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Get Mailbox Database Size in GB Exchange 2010 Powershell Command

Posted on 2013-10-31
5
31,845 Views
Last Modified: 2013-11-01
I presently get my Exchange database statistics using the following command:

Get-MailboxDatabase -Status | Select-Object Name,DatabaseSize,AvailableNewMailboxSpace | Sort-Object Name | fl

Now that my database are over 1TB in size, and I provide my reports in GB, I have to manually convert the TB to GB (in this case I use Google)

Is there a way to have the output on the DatabaseSize ONLY, given in GB.

I do not want the AvailableNewMailboxSpace output modified, as it does a good job providing it in either GB or MB, depending on the size.

Thank you.
0
Comment
Question by:fireguy1125
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 39614358
Simple method is to create a custom property..

@{N="DatabaseSize GB";E={$_.DatabaseSize.ToGB()}}


For example..
Get-MailboxDatabase -Status | Select-Object Name,@{N="DatabaseSize GB";E={$_.DatabaseSize.ToGB()}},AvailableNewMailboxSpace | Sort-Object Name | fl

Open in new window

0
 
LVL 8

Expert Comment

by:EEhotline
ID: 39614548
These are the 2 commands I usually use:

To GB: get-mailbox | Get-MailboxStatistics | Select-Object DisplayName, {$_.TotalItemSize.Value.ToGB()}, DatabaseName | export-csv U:\mbreport.csv

To MB: get-mailbox | Get-MailboxStatistics | Select-Object DisplayName, {$_.TotalItemSize.Value.ToMB()}, DatabaseName | export-csv U:\mbreport.csv

For more details, I use this:

get-mailbox | Get-MailboxStatistics | Select-Object DisplayName, {$_.TotalItemSize.Value.ToMB()}, ItemCount, DatabaseName | export-csv C:\mbreportmb.csv

Hope it helps,
0
 
LVL 1

Author Comment

by:fireguy1125
ID: 39614588
Subsun, your report is what i'm looking for:

-Is there any way to have the Gb results to 2 decimal places? Such as: 1220.35
-Is there any way to have the result include the 'GB', as it just displays the number now, can we have the 'GB' appended to the result (only because it adds an extra step for me to do)

Thanks!
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39614637
Try..
Get-MailboxDatabase -Status | Select-Object Name,@{N="DatabaseSize GB";E={"$([math]::round($_.DatabaseSize.Tobytes() /1Gb, 2)) GB"}},AvailableNewMailboxSpace | Sort-Object Name | fl

Open in new window

0
 
LVL 1

Author Closing Comment

by:fireguy1125
ID: 39616539
Perfect exactly what I need, thanks!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
In this video we show how to create a Distribution Group 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 >>…
In this video we show how to create an Address List 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 Organization >> Ad…

790 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