I've compiled a powershell script to check a bulk of services for an 
application. I did this because added individual checks for each service would 
take an excessive amount of time, there are hundreds of this type of service. I 
too kthe powershell script below and compiled it

It works. My exit code returns great, but I was wondering if there was a way to 
return the $ExampleCheck showing which services were down from which server to 
the error message notification. I played with STDOUT but can't get it to return 
anything and SA will crash.


$Status = Get-Service -ComputerName SERVERNAME | Select-Object -Property 
MachineName,Name,Status,StartType | where-object {$_.Name -like "*EXAMPLE*" 
-and ($_.StartType -like "Automatic") -and ($_.Status -like "Stopped") }



#Write-Output $status.Name

if ($Status.Status -like "Stopped")

    {
        #Write-Output "down"
        $Examplecheck =  $Status.Name + ", register as DOWN."; exit 15
    }

Else

    {
        #Write-Output "up"
        $Examplecheck = $Status.Name + ", register as UP."; exit 14
    }

    $Examplecheck



Good day,

Daniel Howard
Sr. IT Applications Analyst
FileNet / EDM Apps Support
400 S Tryon St
Charlotte, NC  28202
[cid:image001.jpg@01CDCF03.9127F960]

_______________________________________________
Salive mailing list
Salive@woodstone.nu

 To unsubscribe send a mail to salive-requ...@woodstone.nu and in the subject 
of the mail put the following:
unsubscribe

Reply via email to