I'm trying to write a script that iterates through a bunch of sharepoint URLs and verifies that they exist.
From what I can find, it looks like this should work:
$webclient = new-object System.Net.WebClient
$webclient.Credentials = new-object System.Net.NetworkCredential ("username", "password", "domain")
$webpage = $webclient.DownloadString("http://sharepointurl")
This is not working for me ... I keep getting:
Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (401) Unauthorized."
What am I missing ?