Get-MailboxStatistics Provides Incorrect Size
I am running the following command to get a list of all individuals on a particular database and return their name along with size in MB.[PS] C:\>get-mailboxdatabase -identity exchange2007\db01 | Get-MailboxStatistics | select-object displayname,@{expression={$_.totalitemsize.value.toMB()}}When I review my results, some of the sizes are = 0.I verify these mailboxes actually contain data and are greater than 0. Some even being above 1GB. Which should show me a number greater than 0.If I run get-mailboxstatistics on one of these mailboxes, it returns the correct data in any form KB,MB, or GB.Has anyone experienced this in the past or have any idea why this may be ocurring?Thanks.
January 12th, 2010 10:18pm

On Tue, 12-Jan-10 19:18:21 GMT, MJH74 wrote:>I am running the following command to get a list of all individuals on a particular database and return their name along with size in MB.[PS] C:\>get-mailboxdatabase -identity exchange2007\db01 | Get-MailboxStatistics | select-object displayname,@{expression={$_.totalitemsize.value.toMB()}}When I review my results, some of the sizes are = 0.I verify these mailboxes actually contain data and are greater than 0. Some even being above 1GB. Which should show me a number greater than 0.If I run get-mailboxstatistics on one of these mailboxes, it returns the correct data in any form KB,MB, or GB.Has anyone experienced this in the past or have any idea why this may be ocurring?Thanks. If you use "toKB()" instead of "toMB()" what happens? For themailboxes that were previously showing "0" do they now show values?Are the values greater than 1000? Are they greater than 1024?I think you're seeing the results of converting "bytes" to MB wherethe results are less than 1 when the bytes are divided by 1024*1024.---Rich MatheisenMCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2010 6:57am

Same output with you if the mailbox size is less than 1M.I think this question is about syntax with powershell, maybe you should ask a question in windows powershell forum.http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/threadsFrank Wang
January 13th, 2010 9:42am

For example on a mailbox that is 2723094KB in size which is equal to about 2.5GB I get the following results when running the command against the whole database to list all individuals:Running "toKB()" = 189Running "toMB()" = 0Again, if I run just the get-mailboxstatistics on just this mailbox, I get the correct results.Another interesting fact. I created a txt file that contained a list of all users on this mailbox database. Ran the following command:get-content users.txt | get-mailboxstatistics | select-object displayname,{$_.totalitemsize.value.toMB()} > c:\temp\size.txtReceived the correct results.It looks like it has something to possibly due with how I am pulling the account names from the database?Maybe I should move this to the powershell forum?
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2010 7:53pm

I found my problem. The mailboxes displaying the incorrect size had recently be moved between databases on the same server.The command I was running is pulling statistics from disconnected mailboxes along with the valid connected mailbox.Recently moved mailboxes will show up in a disconnected state on the mailbox server.When I dumped the command to a csv file, I can see many of the names listed twice.One with the valid size and one with the incorrect size.Thanks for everyone's help.
January 13th, 2010 8:25pm

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

Other recent topics Other recent topics