0

特定の電子メール アドレスに対して送信された添付ファイルがファイル サーバー上の場所にダンプされるように、サーバー担当者に Exchange で何かを設定してもらいました。

Exchange Event Service はこの動作を制御しますが、この特定のサービスはかなり頻繁に失敗するようです。理由はわかりません。Exchange サーバーにアクセスできず、別の国のチームによって運営されています。

この交換サービスをプログラムで監視して、ダウンした場合にユーザーに警告することはできますか? Exchange チームがこれを処理するのが「正しい」解決策であることはわかっていますが、タイムゾーンの違い (およびそれらの膨大な作業負荷) のために、私が実際に処理する必要があります。

WebDav でこのようなことができますか?

4

1 に答える 1

0

次の 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
  }
于 2010-02-09T04:54:57.313 に答える