Exchange 2010 中邮箱的已用空间

Exchange 2010 中邮箱的已用空间

有没有什么方法可以检查 Exchange 2010 中用户邮箱使用了多少空间。我希望以这种格式获取结果:

名称(别名)| 已分配配额 | 已用空间 | 禁止发送 | 禁止发送/接收

答案1

这比我想象的要难……

从 Powershell 获取用户邮箱的常规信息如下:

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

要查看各种配额,您需要考虑数据库限制以及可能基于每个用户定义的限制。我发现这可以提供此信息。您应该能够修改它以满足您的需求。

$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
    }

相关内容