Hi,
Using the below script we can dump the list of users and their folder size in exchange server 2010
If you want to know how many items are in every mailbox and if all items in mailbox is more than 500 you can use this below script:
$data = $((get-date).ToString('dd.MM.yyyy'))
Function New-Array {,$args}
$Report = New-Array
$count_max = 500
$mbxs = get-mailbox | select -first 100 -resultsize unlimited
foreach ($mbx in $mbxs){
$mbxstat = get-mailboxstatistics $mbx.SAMAccountName
if ($mbxstat.ItemCount -gt $count_max){
$report_tmp = New-Object System.Object
$report_tmp | Add-Member -type NoteProperty -name DisplayName -value $mbx.DisplayName
$report_tmp | Add-Member -type NoteProperty -name ItemCount -value $mbxstat.ItemCount
$Report += $report_tmp
}
}
$Report | ft -auto | Out-String -Width 4096 > d:\scripts\report_count_$data.txt
Send-MailMessage -To youremail@domain.com -From youremail@domain.com -Subject "Mailbox items count $data" -SmtpServer youremailserver -Attachments d:\scripts\report_count_$data.txt
Regards,
Sankar M
Using the below script we can dump the list of users and their folder size in exchange server 2010
# script to list the number of folders in each mailbox
$mbx=get-mailbox
$mbx|select Displayname,@{n="FolderIdCount";e={(get-mailboxfolderstatistics -id $_.Identity | select FolderId).count}} | Sort-Object -Property Displayname | export-csv c:\files\results.csv
If you want to know how many items are in every mailbox and if all items in mailbox is more than 500 you can use this below script:
$data = $((get-date).ToString('dd.MM.yyyy'))
Function New-Array {,$args}
$Report = New-Array
$count_max = 500
$mbxs = get-mailbox | select -first 100 -resultsize unlimited
foreach ($mbx in $mbxs){
$mbxstat = get-mailboxstatistics $mbx.SAMAccountName
if ($mbxstat.ItemCount -gt $count_max){
$report_tmp = New-Object System.Object
$report_tmp | Add-Member -type NoteProperty -name DisplayName -value $mbx.DisplayName
$report_tmp | Add-Member -type NoteProperty -name ItemCount -value $mbxstat.ItemCount
$Report += $report_tmp
}
}
$Report | ft -auto | Out-String -Width 4096 > d:\scripts\report_count_$data.txt
Send-MailMessage -To youremail@domain.com -From youremail@domain.com -Subject "Mailbox items count $data" -SmtpServer youremailserver -Attachments d:\scripts\report_count_$data.txt
Regards,
Sankar M
Really wonderfull script, this will help many of our people and also we will be expecting more from you.
ReplyDelete