【发布时间】:2010-12-04 16:02:47
【问题描述】:
我正在尝试编写一个脚本来遍历一堆共享点 URL 并验证它们是否存在。
据我所知,这应该可行:
$webclient = new-object System.Net.WebClient
$webclient.Credentials = new-object System.Net.NetworkCredential ("username", "password", "domain")
$webpage = $webclient.DownloadString("http://sharepointurl")
这对我不起作用......我不断收到:
使用“1”参数调用“DownloadString”的异常:“远程服务器返回错误:(401) 未经授权。”
我错过了什么?
【问题讨论】:
-
您可以使用 fiddler 或 wireshark 来检查请求以确保其上有 auth 部分吗?
标签: sharepoint authentication powershell active-directory