Unable to export content from a Sharepoint list

Posted by on Feb 7, 2015 in PowerShell, SharePoint

I recently attempted to export content from a SharePoint list using PowerShell but ran into a few issues with the Export-SPWeb cmdlet.
Firstly, I had a problem whereby the documented syntax of the cmdlet just didn’t work. It took a few hours playing about and guesswork to discover the syntax that played nicely with SharePoint 2013.

The documented syntax is as follows:

However, attempting to transpose this to my own SharePoint site didn’t play ball. Using the following syntax, however, did in fact work:

So rather than supplying the Site URL at a collection level, I had to append the site name to the –Identity parameter and omit it from the path to the list.

My next issue was permissions based, with not having adequate permissions to perform this operation. There are a plethora of permissions needed to successfully execute this command. This includes:

  • securityadmin fixed server role on the SQL Server instance.
  • db_owner fixed database role on all databases that are to be updated.
  • Administrators group on the server on which you are running the Windows PowerShell cmdlets.
  • The user is a server farm administrator.
  • The user is a site collection administrator.

With the above, and the correct syntax, things should hopefully work for you.