Help getting total file size

Does anyone know how to get the total size of a mailbox database? I tried the following but it errors out because its null.

Get-MailboxStatistics -Database $MBXDB.DistinguishedName | %{$_.TotalItemSize.Value.ToMB()}|Measure-Object -sum Error: % : You cannot call a method on a null-valued expression. At line:1 char:60 + ... e $MBXDB.DistinguishedName | %{$_.TotalItemSize.Value.ToMB()}|Measure ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [ForEach-Object], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull,Microsoft.PowerShell.Commands.ForEachObjectCommand 


submitted by /u/worklifebalancepls
[link] [comments]

Leave a Reply