如何使用Web服务访问Sharepoint中的子站点列表?

eck*_*kes 2 powershell sharepoint web-services

在尝试使用Web服务(在powershell上)访问我的sharepoint站点时,遇到以下配置时遇到问题:

  • 我的网站位于 https://sharepoint.company.tld/sites/siteid/
  • WSDL是从https://sharepoint.company.tld/_vti_bin/Lists.asmx(从重定向https://sharepoint.company.tld/sites/siteid/_vti_bin/Lists.asmx)获取的

在构建Web服务DLL之后(按照这些步骤),我做了一个

$list = New-Object Lists
Run Code Online (Sandbox Code Playgroud)

并尝试通过它的GUID获取列表(我知道):

$docs = $list.GetList("GUID-HERE")
Run Code Online (Sandbox Code Playgroud)

这会导致异常: 截图 按名称检索列表是一样的.

做一个$list.GetListCollection()返回我已知的列表https://sharepoint.company.tld,是的,我的列表不在其中.只有一些包含webpart的列表将用于真实站点和类似的东西.

所以,这里有一个问题:我有什么方法可以告诉Web服务他们不能访问位于下面的列表https://sharepoint.company.tld但是搜索位于的列表https://sharepoint.company.tld/sites/siteid/Lists

Mad*_*uja 5

看看这个:http: //www.nivot.org/2008/02/29/ManipulatingRemoteSharePointListsWithPowerShell.aspx

您只需要设置Url属性

$list.Url = "http://sharepoint/sites/root/subsite/_vti_bin/lists.asmx"
Run Code Online (Sandbox Code Playgroud)