【问题标题】:How can I monitor the Exchange 2003 Event Service from my application?如何从我的应用程序监视 Exchange 2003 事件服务?
【发布时间】:2010-06-28 01:00:05
【问题描述】:

我们让我们的服务器人员在 Exchange 上设置了一些东西,以便对于特定的电子邮件地址,发送到它的任何附件都将被转储到文件服务器上的某个位置。

Exchange 事件服务控制此行为,但似乎此特定服务经常失败。我不知道为什么 - 我无法访问 Exchange 服务器,它是由另一个国家的团队运行的。

是否可以通过编程方式监控此交换服务,以便在它出现故障时向用户发出警告?我知道“正确”的解决方案是让 Exchange 团队处理这个问题,但由于时区差异(以及他们的巨大工作量),我真的需要从头开始处理它。

你能用 WebDav 做这样的事情吗?

【问题讨论】:

    标签: exchange-server exchange-server-2003


    【解决方案1】:

    您可以使用以下 powerShell 脚本:

    # Getting status of Exchange Services and look for anything that's "stopped"
    $ServiceStatus = get-service MSExch* | where-object {$_.Status -eq "stopped"}
    
    # Convert Result to String
    $ServiceStatusText = $ServiceStatus | fl | Out-String
    
    # If $ServiceStatus <> $null then send notification
    If ($ServiceStatus -ne $null)
     {
     ###Exchange Server Values
     $FromAddress = "Exchange-Alert@YOUR_DOMAIN.local"
     $ToAddress = "your_address@YOUR_DOMAIN.com"
     $MessageSubject = "CRITICAL: An exchange service is has stopped"
     $MessageBody = "One or more Exchange services has stopped running or crashed. Please check the server ASAP for possible issues`n"
     $MessageBody = $MessageBody + $ServiceStatusText
    
     $SendingServer = "msexch02.pnlab.local"
    
     ###Create the mail message and add the statistics text file as an attachment
     $SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody
    
     ###Send the message
     $SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer
     $SMTPClient.Send($SMTPMessage)
    }
    
    # Else don't do anything and exit
    Else
      {
      $null
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-04
      • 2011-05-09
      • 1970-01-01
      相关资源
      最近更新 更多