相关疑难解决方法(0)

Get-SPWeb无法找到具有ID或URL的对象

题:

我似乎无法弄清楚为什么我收到下面的错误,即使SharePoint站点存在,以及被调用的文档库.文档库Lib1有文件/文件夹,文件库Lib2是空的.谁知道出了什么问题?


错误:

Get-SPWeb : Cannot find an SPWeb object with Id or Url : Lib1 and site Url https://sharepoint.oshirowanen.com/sites/oshirodev.
At C:\Users\Oshiro\Desktop\CopyDocs.ps1:31 char:23
+       $web = Get-SPWeb <<<<  -Site $site -Identity $identity -ErrorAction Stop;
    + CategoryInfo          : InvalidData: (Microsoft.Share....SPCmdletGetWeb:SPCmdletGetWeb) [Get-SPWeb], SPCmdletPipeBindException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetWeb
Run Code Online (Sandbox Code Playgroud)

脚本:

01  Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
02  
03  function Get-SPList([uri]$url) {
04    # Nullify variables $site, $web and $list
05    $site = $web = $list = $null
06  
07    # Get …
Run Code Online (Sandbox Code Playgroud)

powershell sharepoint powershell-2.0 sharepoint-2010

6
推荐指数
1
解决办法
1686
查看次数