IIS Monitoring Script for all website pagesRSS

3 replies

Last post Mar 07, 2019 06:58 AM by Jalpa Panchal

  • IIS Monitoring Script for all website pages

    Mar 05, 2019 05:50 PM|HSever|LINK

    I need to setup a monitoring script/or method to test if all pages of the website are up. running Win 2016/IIS10. do you have a PS script, hyperlink or method that I can apply (I am interested in the monitoring script/part, not the scheduling)
    I consider running through Task Scheduler .

    I posted in another IIS forum but did not get a pertaining reply. I also posted on TechNet PS site but was advised to post to this IIS Configuration and Scripting site instead.


    Thank you,

  • Re: IIS Monitoring Script for all website pages

    Mar 06, 2019 07:34 AM|Jalpa Panchal|LINK

    Hi HSever,

    You could use below PowerShell script to check the status of a URL:

    # We then get a response from the site.
    $HTTP_Response = $HTTP_Request.GetResponse()
    
    # We then get the HTTP code as an integer.
    $HTTP_Status = [int]$HTTP_Response.StatusCode
    
    If ($HTTP_Status -eq 200) {
        Write-Host "Site is OK!"
    }
    Else {
        Write-Host "The Site may be down, please check!"
    }
    
    # Finally, we clean up the http request by closing it.
    $HTTP_Response.Close()
    

    Or you could use Microsoft tool to Monitor availability and responsiveness of any web site:

    https://docs.microsoft.com/en-us/azure/azure-monitor/app/monitor-web-app-availability#setup

    Regards,

    Jalpa.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: IIS Monitoring Script for all website pages

    Mar 07, 2019 04:02 AM|HSever|LINK

    Hi Jalpa, the script it is in the right direction, but shows just testing for a URL and I need more complete solution, query all pages/sites under website, log results, email failures/timeouts/etc. 

    Microsoft tool would not work since it is for intranet.

    Thank you,

  • Re: IIS Monitoring Script for all website pages

    Mar 07, 2019 06:58 AM|Jalpa Panchal|LINK

    Hi,

    If you want that type of script or tool you need to buy a scripting tool or write script by your self  because there is no tool provided by IIS. You could request as new feature of IIS. 

    There is another script for your reference is below:

    https://dotnet-helpers.com/powershell/powershell-script-for-website-availability-monitoring-with-excel-report-as-output/

    Regards,

    Jalpa.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.