This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

PowerShell monitor for Office Web Apps server

Been banging my head a bit here; figured I'd see if the community has a light to shed. emoticons_happy.png

Trying to create a PowerShell script monitor for my Office Web Apps servers.

What I want it to do is run 'Get-OfficeWebAppsMachine' and if the HealthStatus property of the result is Healthy, mark the component as Up. If the property value is 'UnHealthy' mark it down, anything else mark as Unknown.

I've tried a few permutations, but the Test Script Output always just says 'Not Defined'.

Here's one of the scripts I tried:

Import-Module OfficeWebApps

$health = (Get-OfficeWebAppsMachine).HealthStatus

if ($health -eq 'Healthy'){

    $stat = '0'

    write-host "Health.Message: $health"

    Write-host "Health.Statistic: $stat"

    Exit(0)

}