Today I am providing the Power Shell Script that will download all the documents of all the Libraries under each sites/site collections/web application in to your file system. It is useful if you want to take backup of SharePoint in current SharePoint farm where the script will be executed. Folder structure will be the same as in SharePoint and Site url will be converted as folder to identify the sites.
Script will accept the reports file path where it will create the folder and download the files there -
Inputs - Following are the Input for the script.
Report File Path - Path for saving the files.
Outputs - Following output files will be generated on provided Report File Path, with their respective name and under the folder structure of the site.
For executing this script user must be added in site collection administrators in all the sites.
User should have Shell Admin rights to run the scripts.
Run Management Shell as an Administrator.
How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in SharePoint Management Shell.
Follow on screen instructions.
Go to above link to get the script.