Monitoring the SafeGuard Enterprise Server status using Microsoft Windows PowerShell

  • N.º del artículo: 120938
  • Actualizado: 30 abr 2014

The following Knowledge Base Article explains how to execute the SafeGuard Enterprise Server Invoke test using SOAP via Windows PowerShell script - either locally on the SafeGuard Enterprise Server or from a remote machine - so that the status of the SafeGuard Enterprise Server can be monitored automatically.

Applies to the following Sophos product

SafeGuard Enterprise Server

What To Do

The following Windows PowerShell script can be used to monitor the SafeGuard Enterprise Server status locally on the SafeGuard Enterprise Server:

$url = "http://localhost/sgnsrv/Trans.asmx"
$parameters = "<?xml version=""1.0"" encoding=""utf-8""?><soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope""><soap12:Body><CheckConnection xmlns=""http://tempuri.org/"" /></soap12:Body></soap12:Envelope>"

$http_request = New-Object -ComObject Msxml2.XMLHTTP
$http_request.open('POST', $url, $false)
$http_request.setRequestHeader("Content-type","application/soap+xml; charset=UTF-8")
$http_request.setRequestHeader("Content-length", $parameters.length)
$http_request.setRequestHeader("Connection", "close")
$http_request.send($parameters)
$http_request.statusText


Download:
CheckConnection.zip

Please Note: If the CheckConnection script should be executed from a remote machine, make sure to adjust the $url string with the correct server adress of the SafeGuard Enterprise Server (e.g. "$url = "http://sgnserver.domain.com/sgnsrv/Trans.asmx")

 
Si necesita más ayuda, póngase en contacto con soporte técnico.

Valore el artículo

Muy malo Excelente

Comentarios