How to use Powershell for a custom check in Servers Alive In Servers Alive you can use an external program as a check. This external program could be your own Powershell script. This howto explains how to do this.


  1. Below is an example of a powershell script that checks if a certain registry value is still 1. You save this script as (example!) c:\data\myscripts\reg_check.ps1
    $RemoteServer=$args[0]
    $RefValue=1
    $Value=Invoke-Command -computername $RemoteServer -ScriptBlock {(get-itemproperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Agent\2.0").Forcefixup}
    if ($Waarde -eq $RefValue)
    {
    write-host "OK. Value ForceFixup is $Value. "
    exit 0
    }
    else
    {
    write-host "Error. Value ForceFixup is $Value, must be $RefValue."
    exit 1
    }
  2. In Servers Alive create a new entry and as check type select EXTERNAL (ERRORLEVEL)


  3. As commandline enter:
    powershell -NoProfile -ExecutionPolicy bypass -File "c:\data\myscripts\reg_check.ps1" %h
    and as rule you would set it to "is <> from 0"





  4. Woodstone would like to thank David White for creating the document on which this HOWTO is based.
Order online Servers Alive to monitor your network
Program Features
What's new in v8.x?
Download
Document Collection
Template examples
Free add-ons
License Agreement
Prices from 199 EURO
Different editions

Download Free Trial Servers Alive

from our main website
or download it from one of our mirror download sites around the world.
If you're a business owner or manager, you know that network outages can affect your income, brand integrity, and bottom line. Here's a non-technical description of how Servers Alive can monitor your network and alert your IT staff when there's a problem.

Servers Alive - Like Life Insurance For Your Business - Only Cheaper

Try Before You Buy!

Try Servers Alive for FREE with no time limit....
You can try all of the features to see if the program meets your needs.
Download page

Customer praise

"Fantastic product. I finished setting up my checks this morning and making minor adjustments. Just 15 minutes online I received my first alert. I thought it may be a configuration issue, but it was a real alert for a real problem Thanks for a superior product at a very resonable price. This poduct would be worth the money at three times the price!"

Robert Armstrong
Information Technology Manager
Invesmart, Inc.