Create SharePoint containers and copy files
with PowerShell scripts
Move files into SharePoint 4
A SharePoint tutorial by Peter Kalmstrom
Kalmstrom, CEO of kalmstrom.com Business Solutions and Microsoft
certified SharePoint specialist, has in an assignment planned
a move of millions of Office files into SharePoint.
The process has been described in three earlier Tips articles,
Convert old files to
modern formats and Create
Site collections. This is the last article.
In the first part of the demo below Peter discusses different
kinds of SharePoint containers, and he even shows a bad
way of storing data in SharePoint - using folders like in
the old days.
After that he shows two better ways. One uses subsites and
document libraries, and one uses only document libraries
but combines that with a choice of file names used as tags,
so that relevant views can be created for the library. In
that sense you can call the tags "containers" too.
Step by step
- Decide what kind of SharePoint containers you wish
to use - site collections, subsites or document libraries.
Also decide if some of the old folder or file names
should be used as tags.
- Enter folder paths, levels, clean folder names and
container choices in an Excel file. Also include other
information that you wish to have transferred to SharePoint,
as file size or last changed date. Save the file as
CSV. All this can be done using the PowerShell script
I have included in the article about Fileshare inventory.
- Run the CreateContainers.ps1 script to create the
SharePoint containers you wish to use for your files.
This script creates the containers and a CSV log file
with information about the old paths and the corresponding
- Enter the path to the CSV log file in the script
CopyFiles.ps1 to copy the files from the old folder
system to the SharePoint containers.