Powershell to calculate amount of space used in a database

Hi there,

I need a script that will calculate the amount of space each person is using in Exchange 2007. In MB please.

Tacobell
Tacobell2000Asked:
Who is Participating?
 
jorlando66Connect With a Mentor Commented:
Get-MailboxStatistics | Sort-Object TotalItemSize –Descending | ft DisplayName,@{ expression={$_.TotalItemSize.Value.ToKB()}},ItemCount >>c:\mail.txt

Will pipe the results to c:\mail.txt
0
 
jorlando66Commented:
Get-MailboxStatistics | Sort-Object TotalItemSize –Descending | ft DisplayName,@{ expression={$_.TotalItemSize.Value.ToKB()}},ItemCount

Change KB to MB for megabyte display or GB to gigabyte..
0
 
endital1097Commented:
do you want to include the deleted item retention
this breaks it down by mailbox with both
0
 
endital1097Commented:
it erased my code

Get-Mailbox | ForEach-Object { $stats = Get-MailboxStatistics $_.Name ;
$size = $stats.totalitemsize.value.tomb() + $stats.totaldeleteditemsize.value.tomb();
write-host $stats.displayname $size }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.