• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

Exchange mailbox stats. need to get the results in MB rather than bytes.

Hi,

Exchange mailbox stats. need to get the results in MB rather than bytes.

I have the below code from a expert. Can this be able to fetch in MB

Get-MailboxStatistics -Database "EX07\First Storage Group\Mailbox Database" | select displayname, totalitemsize | export-csv c:\result.csv

Regards
Raja
0
bsharath
Asked:
bsharath
  • 2
1 Solution
 
DhaestCommented:
Why don't you convert the bytes to MB when you received it ?

http://technet.microsoft.com/en-us/library/ee692684.aspx
0
 
bsharathAuthor Commented:
I get the stats from 20,000 mailboxes. Could be useful some way within the code
0
 
DhaestCommented:
Convert the Get-MailboxStatistics output from Bytes to MB or GB in Exchange 2007.
http://aspoc.net/archives/2007/11/07/convert-the-get-mailboxstatistics-output-from-bytes-to-mb-or-gb-in-exchange-2007/


Customizing results
This is all fine and good, but having to figure out how big a mailbox is based on the number of bytes is more math than we should have to use. Fortunately, we can convert bytes to MB by replacing the “TotalItemSize” field with

@{expression={$_.TotalItemSize.Value.ToMB()}

http://www.petri.co.il/getting-mailbox-sizes-in-powershell.htm
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now