获取 Exchange 邮箱统计信息的总和 [英] Get Sum of Exchange Mailbox Statistics
问题描述
我正在尝试使用命令获取 Exchange 数据库的 TotalItemSize
总和
I'm trying to get the sum of the TotalItemSize
for an Exchange database using the command
Get-MailboxStatistics -Database MBX07 |Measure-Object -Sum TotalItemSize
该命令在 Windows PowerShell ISE 中运行良好,但如果我在 Exchange EMS 中运行它(两者都在我的本地计算机上),我会收到数据库中每个邮箱的错误
The command works perfectly fine in the Windows PowerShell ISE but if I run it in an Exchange EMS (both are on my local machine) I get errors for every mailbox in the database that say
测量对象:输入对象8.518 MB(8,932,049 字节)"不是数字.
Measure-Object : Input object "8.518 MB (8,932,049 bytes)" is not numeric.
命令工作的 ISE 中的输出看起来像
The output in the ISE where the command works looks like
Count : 174
Average :
Sum : 203481256406
Maximum :
Minimum :
Property : TotalItemSize
这是一台在 Windows Server 2008 R2 上运行的 Exchange 2010 SP1 服务器,我运行的是 Windows 8.1 64 位
It's an Exchange 2010 SP1 server running on Windows Server 2008 R2 and I'm running Windows 8.1 64bit
非常感谢任何帮助
推荐答案
这是从我服务器上的 EMC 运行的.
This was run from my EMC on my server.
Get-MailboxStatistics -Database MBX07 | ForEach-Object {[Microsoft.Exchange.Data.ByteQuantifiedSize]::Parse($_.TotalItemSize)} | Measure-Object -sum
TotalItemSize
是 Microsoft.Exchange.Data.ByteQuantifiedSize
类型,所以我们使用它的方法 Parse
来获取我们可以放入 Parse
的值代码>-sum
TotalItemSize
is of type Microsoft.Exchange.Data.ByteQuantifiedSize
so we use its method Parse
to get a value we can put into -sum
更多相关信息此处
奖金
你可以试试这个,它会以 MB 为单位输出总和
You can try this which will output the Sum in MB
Get-MailboxStatistics -Database MBX07 | ForEach-Object {
([Microsoft.Exchange.Data.ByteQuantifiedSize]::Parse($_.TotalItemSize)).ToMb()
} | Measure-Object -sum
这篇关于获取 Exchange 邮箱统计信息的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!