size to MB

I am having a problem with a script.

If I do

get-mailboxstatistics -id xxx| select itemcount, totalitemsize

I get the correct answers (i.e. no of items and the mailbox size in KB)

I want to display the size in MB so I tried

get-mailboxstatistics -id xxx| select itemcount, @{label="MB";expression={$_.totalitemsize.value.tomb()}}

But I get a blank value and can't work out why. I have read quite a few different posts and it looks like I ave the right syntax but not the right result

Any ideas?

TIA

Andy

February 11th, 2015 9:58am

If you're trying to do this in a script, I would pipe the results to a variable first 

$mbstats = Get-MailboxStatistics xxx | Select-Object TotalItemSize, ItemCount, .....

Then I would manipulate the total item size either right after this, or when I go to display it, then this should work:

$mbstats.totalitemsize.value.tomb()

or if you want to do it in one line try:

Get-MailboxStatistics xxx | Select-Object itemcount, totalitemsize | Select-Object ItemCount, @{label="MB";expression={$_.totalitemsize.value.tomb()}}

Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 10:18am

I hope, the above suggested command would help you to get the correct result.

However, if you still unable to find the edb size reports, you may try this automated application (http://www.exchangereports.net/) that could be a good alternative approach for you.

February 12th, 2015 5:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics