bestu 发表于 2018-9-2 10:33:47

【Powershell】【计数器】实时获取邮箱服务器的队列

  邮箱服务器的队列在对邮箱服务器的管理中是相当重要的一环,过高的队列会导致邮件收发极度缓慢,甚至导致服务器的宕机.而在服务器异常时,本来打开就非常缓慢的队列查看器会更加缓慢,这里介绍一种非常简单的方法去持续跟踪服务器的邮件队列:
  $counter = New-Object Diagnostics.PerformanceCounter
  $counter.CategoryName = “MSExchangeTransport Queues”
  $counter.CounterName = “Messages Queued For Delivery”
  $counter.InstanceName = “_Total”
  while ($true)
  {
  $value = $counter.NextValue()
  Write-Host “MessageQueue: $value”
  sleep 1
  }
  命令扩散开来,也可以用去其他计数器的监控.

页: [1]
查看完整版本: 【Powershell】【计数器】实时获取邮箱服务器的队列