Solved

Powershell to calculate amount of space used in a database

Posted on 2010-09-03
4
387 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In this video we show how to create a mailbox database 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 Servers >> Data…
how to add IIS SMTP to handle application/Scanner relays into office 365.

790 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