0
將Microsoft.Exchange.Data.EnhancedTimeSpan
和Microsoft.Exchange.Data.ByteQuantifiedSize
分別轉換爲秒和字節(或megs)的正確方法是什麼,以便我可以將它們分開?在Powershell中獲得每秒兆字節數(主要是鑄造問題)
function Get-MBStats($Username = "someuser")
{
$UserDetail = (Get-MailboxStatistics -Identity $Username -IncludeMoveHistory).MoveHistory[0]
# | ft status, targetdatabase , completiontimestamp , totalmailboxsize ,overallduration -auto#
# What is the syntax for this?
$DataRate = $UserDetail.OverallDuration/$UserDetail.TotalMailboxSize
New-Object PSObject -Property @{
Username = $Username
Status = $UserDetail.Status
TargetDatabase = $UserDetail.TargetDatabase
CompletionTime = $UserDetail.CompletionTimestamp
TotalMailboxSize = $UserDetail.TotalMailboxSize
OverallDuration = $UserDetail.OverallDuration
Rate = $DataRate
}
# Todo: GUI http://msdn.microsoft.com/en-us/magazine/hh288074.aspx #
}
Get-MBStats