Hi i manage a few internal sites like
$sites = site1.mycompany.com , site2.mycompany.com , site3.mycompany.com
I would like to monitor them and make sure they are up.
What is the best way to do this?
foreach ($site in $sites) { $web = Invoke-WebRequest -Uri $site }
I can look into the $web.statuscode and if -eq "200", and $$web.Statusdescription -eq "OK" this means that the page is fine, correct?
But if i try to query a wrong site it fails, i still get a code 200 and description OK.
So i guess this is not a proper way?
Thanks