0

I'm using the following script to export some lists:

foreach($spListUrl in $deploymentXml.Configuration.Lists.ListUrl)
{
    Export-SPWeb -Identity $pwaSiteUrl -ItemUrl $spListUrl -Path $listExportFilePath -IncludeUserSecurity -IncludeVersions 4 -NoFileCompression -Force
}

I previously got the URLs using:

$web = Get-SPWeb $webAppUrl
foreach ($list in $web.lists)
{
     $list.RootFolder.Url
}

The thing is that the script does export some lists while when trying to export other I get this error:

Export-SPWeb : The URL provided is invalid. Only valid URLs that are site collections or sites are allowed to be exported using stsadm.exe.

I've checked all the URLs and all of them exist so I don't know where the problem could be.

1

This is an old question, but in case you are still looking for an answer: the value of the ItemURL parameter has to be a valid relative URL, i.e. it has to start with a / character. Check the values you are putting in $spListUrl.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.