This free service has been made available so that you can check the safety of a particular URL that might seem suspicious. Trend Micro reserves the right to block automated programs from submitting large numbers of URLs for analysis. URL Status can be implemented in a variety of ways to maximize revenue potential or differentiate a product. Whether you want to protect your customer at the device level or in the cloud, URL Status Service prevents malicious activities. Scans all URLs or IP addresses at the endpoint or device level regardless of the web browser used.
Similar to this question here I am trying to monitor if a set of website links are up and running or not responding. I have found the same PowerShell script over the Internet.
However, instead of direct website links I need to check more specific links, for example:
When I am trying to check on the status of these links, I get the following output:
The above links requires me to be connected to the VPN, but I can access these links from the browser.
Output of Invoke-WebRequest -Uri https://stackoverflow.com/questions/20259251/powershell-script-to-check-the-status-of-a-url
:
$PSVersionTable
I recently set up a script that does this.
As David Brabant pointed out, you can use the System.Net.WebRequest
class to do an HTTP request.
To check whether it is operational, you should use the following example code:
Peter MortensenFor people that have PowerShell 3 or later (i.e. Windows Server 2012+ or Windows Server 2008 R2 with the Windows Management Framework 4.0 update), you can do this one-liner instead of invoking System.Net.WebRequest
:
Below is the PowerShell code that I use for basic web URL testing. It includes the ability to accept invalid certs and get detailed information about the results of checking the certificate.
JamieSeeJamieSee