none
Export-SPWeb: Cannot find an SPWeb object with id or url for SharePoint 2010 env.

    Question

  • I can't seem to resolve the URL problem associated with the "Export-SPWeb" command below.  Am trying to copy a Document Library from one site to a different pre-existing site (both sites are located within the same site collection).  Have looked at other examples and experimented with many values, but can not seem to overcome this problem.  The "Export-SPWeb" values are hardcoded right now, just to ensure its not a parameter passing problem.

    {
    	Export-SPWeb http://server/webapp -ItemUrl "/SiteCollection/subsite1/subsite2/Library" -Path "E:\location1\location2\$name.cmp"
    }

    Results:

    Export-SPWeb : Cannot find an SPWeb object with Id or Url : http://server/webapp.
    At E:\location1\location2\PowerShellScript.ps1:106 char:14
    +     Export-SPWeb <<<<  http://server/webapp -ItemUrl "/sitecollection/subsite1
    /subsite2" -Path "E:\location1\location2\$name.cmp"
        + CategoryInfo          : InvalidData: (Microsoft.Share...CmdletExportWeb:
       SPCmdletExportWeb) [Export-SPWeb], SPCmdletPipeBindException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWe
       b


    Cheryl

    Thursday, March 29, 2012 11:59 PM

Answers

  • Try this:

    Export-SPWeb http://SiteCollection/subsite1/subsite2 -ItemUrl "http://SiteCollection/subsite1/subsite2/Library" -Path "E:\location1\location2\$name.cmp"

    you should specify, the complete URL of the the SPWeb as Identity and complete URL of the library under the SPweb passed in the identity or the first param.

    Hope this helps.



    Rahul Gupta, MCPD - SharePoint 2010

    Saturday, March 31, 2012 3:34 AM