Solved

Powershell to calculate amount of space used in a database

Posted on 2010-09-03
4
365 Views
Last Modified: 2012-05-10
Hi there,

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

Tacobell
0
Comment
Question by:Tacobell2000
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:jorlando66
ID: 33598512
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
 
LVL 10

Accepted Solution

by:
jorlando66 earned 500 total points
ID: 33598545
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
 
LVL 32

Expert Comment

by:endital1097
ID: 33598686
do you want to include the deleted item retention
this breaks it down by mailbox with both
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33598709
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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now