Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there any way to check, how much space has been used by an user mailbox in Exchange 2010. I would like to get the result in this format:

Name (Alias) | Quota Assigned | Used Space | Send Prohibit | Send/Receive Prohibit

share|improve this question

1 Answer 1

up vote 2 down vote accepted

This is harder than I thought...

Getting general information from Powershell for user mailboxes would be something like:

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,TotalItemSize,StorageLimitStatus

To view the various quotas, you need to consider the database limits as well as what may be defined on a per-user basis. I've found this to provide this information. You should be able to modify this to fit your needs.

$u = Get-Mailbox

foreach ($m in $u) {
    $TotalItemSize              = @{n="TotalSize";
                                    e={ 
                                        if ( (Get-MailboxStatistics -Identity $m).TotalItemSize.Value) {
                                            (Get-MailboxStatistics -Identity $m).TotalItemSize.Value.ToMB()
                                            } else {"-"}
                                         }
                                    }
    $ProhibitSendQuota          = @{n="ProhibitSendQuota";
                                    e={
                                        if ( (Get-Mailbox $m).ProhibitSendQuota.Value) {
                                            (Get-Mailbox $m).ProhibitSendQuota.Value.ToMB()
                                            } else {"-"}
                                        }
                                    }
    $ProhibitSendReceiveQuota   = @{n="ProhibitSendReceiveQuota";
                                    e={ 
                                        if ( (Get-Mailbox $m).ProhibitSendReceiveQuota.Value) {
                                            (Get-Mailbox $m).ProhibitSendReceiveQuota.Value.ToMB()
                                            } else {"-"}
                                        }
                                    }
    $IssueWarningQuota          = @{n="IssueWarningQuota";
                                    e={ 
                                        if ( (Get-Mailbox $m).IssueWarningQuota.value) {
                                            (Get-Mailbox $m).IssueWarningQuota.value.ToMB()
                                            } else {"-"}
                                        }
                                    }
    $DBProhibitSendQuota        = @{n="DBProhibitSendQuota";
                                    e={
                                        if ( (Get-MailboxDatabase -Identity $m.Database).ProhibitSendQuota.Value) {
                                            (Get-MailboxDatabase -Identity $m.Database).ProhibitSendQuota.Value.ToMB()
                                            } else {"-"}
                                        }
                                    }
    $DBProhibitSendReceiveQuota = @{n="DBProhibitSendReceiveQuota";
                                    e={
                                        if ( (Get-MailboxDatabase -Identity $m.Database).ProhibitSendReceiveQuota.Value) {
                                            (Get-MailboxDatabase -Identity $m.Database).ProhibitSendReceiveQuota.Value.ToMB()
                                            } else {"-"}
                                        }
                                    }

    get-mailbox -resultSize unlimited $m | `
        select  name,`
                $TotalItemSize,`
                $ProhibitSendQuota,`
                $ProhibitSendReceiveQuota,`
                $IssueWarningQuota,`
                $DBProhibitSendQuota,`
                $DBProhibitSendReceiveQuota
    }
share|improve this answer
    
Thanks ewwhite. –  Kamaljeet Kumar Nov 17 '11 at 6:16
    
Did this work for you? –  ewwhite Nov 17 '11 at 12:54
    
Yes, it worked for me. I just used "" Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName,StorageLimitStatus,@{name="MailboxSize";exp={$_.totalitemsize}} | Sort-Object StorageLimitStatus,MailboxSize -descending | Convertto-Html | out-File D:\Script\Reports\report.htm "" and this is enough for me. Although, I have tested above script also and that worked too. I got a long report of all users, I'll use that for monthly report. Thanks for your support. –  Kamaljeet Kumar Nov 18 '11 at 3:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.