Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, September 12, 2013 8:46 PM
Hi - I have two SharePoint site collections. Under Libraries we have so many folders and sub-folders. When I create new site collection (or existing) I want to copy same structure to new site collection. I do NOT want to copy the files.
Can someone point to a right direction or show me how can it be done using Power-Shell script?
Thanks,
Nick
All replies (3)
Friday, September 13, 2013 3:46 AM âś…Answered
1) You can open the library in windows explorer (copy entire directory to a different location on your system, write a cmd script to delete all files from folder sub folder, and finally you will have the folder structure
2) Open the second site collection library in windows explorer and c copy the folder structure from step 1 to the second site collection library in windows explorer
I assume that you do not have custom content types metadata attached to the folders
OR
You can maintain the heirarchy of folder structure in one csv file, and write PowerShell script to read csv and create the folders (item) wherever you want
Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
Everything about SQL Server | Experience inside SQL Server -Mohammad Nizamuddin
Friday, September 13, 2013 7:03 AM
Hello,
You can use CAML Query to get all sub folders inside a folder excluding files
once you get all the folders and their path...create folders using programattically.
Hint:
CAML Query: This will ensure all item is folder and add one more condition to search based on supplied path and in view fields get the path of folders and foldername
FSObjType=1 {Folder}
FSObjType=0{Files}
<FieldRef Name='FSObjType'/><Value Type='Lookup'>1</Value></
Thanks,
Nilesh
Nilesh Jain
Monday, September 16, 2013 1:39 PM
Thanks for the Second solution. I will end up doing send option.