I have got a need to check ISS Service status whether running or stopped. So I am using
Get-Service AppHostSVC,FTPSVC,IISAdmin,MSFTPSVC,W3SVC,WAS,WMSVC
I need to run this for command for every 5 minutes, so I am using this script
Import-Module TaskScheduler $task = New-Task
$task.Settings.Hidden = $true
Add-TaskAction -Task $task -Path C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe –Arguments “Get-Service AppHostSVC,FTPSVC,IISAdmin,MSFTPSVC,W3SVC,WAS,WMSVC”
Add-TaskTrigger -Task $task -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 5)
Register-ScheduledJob –Name ”Monitor IIS Service” -Task $task
I need to show the status of those services as a Web page in c:\IISServiceChecker.html which will be refreshed every 5 minutes. This part I am struggling on how to put the status in a web page. Any help would be much appreciated Thank you