给定以下配置,尝试使用Web服务(在Powershell上)访问我的SharePoint网站时遇到问题:
https://sharepoint.company.tld/sites/siteid/
https://sharepoint.company.tld/_vti_bin/Lists.asmx
(从https://sharepoint.company.tld/sites/siteid/_vti_bin/Lists.asmx
重定向)中获取的构建了Web服务DLL(遵循these步骤)之后,我执行了
$list = New-Object Lists
并尝试通过它的GUID(我所知)获取列表:
$docs = $list.GetList("GUID-HERE")
这导致异常:
通过名称检索列表是相同的。
进行
$list.GetListCollection()
可以返回https://sharepoint.company.tld
已知的列表,是的,我的列表不在这些列表中。仅包含Webpart的某些列表应用于实际站点和类似内容。所以,这是一个问题:有什么办法可以告诉Web服务它们不访问位于
https://sharepoint.company.tld
下的列表,而是搜索位于https://sharepoint.company.tld/sites/siteid/Lists
上的列表? 最佳答案
看看这个:
http://www.nivot.org/2008/02/29/ManipulatingRemoteSharePointListsWithPowerShell.aspx
您只需要设置Url属性
$list.Url = "http://sharepoint/sites/root/subsite/_vti_bin/lists.asmx"