Utilized Space by a mailbox in Exchange 2010

exchange-2010

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

Best Answer

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
    }