| |
| ||||||
PowerShell One Liner: Duplicating a folder structure in a Sharepoint document libraryThis is a discussion on PowerShell One Liner: Duplicating a folder structure in a Sharepoint document library within the Random Procrastination forums, part of the CORTEX Blogs category; I was asked by someone at work the other day, if it was possible in Sharepoint to create a set of top level folders in one document library based on ... |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
| | #1 |
| Senior Member Join Date: Jun 2009
Posts: 62
![]() | I was asked by someone at work the other day, if it was possible in Sharepoint to create a set of top level folders in one document library based on the set of folders in another library. One document library has a set of top level folders that is basically a client list and we needed to create the same top level folders in another library. I knew that it was possible to open a Sharepoint document library in explorer using a UNC style path and that you could map a drive using a technique like this one: http://www.endusersharepoint.com/200...-mapped-drive/. But while explorer would let us copy the folders, it would also take all of the folder contents too, which was not what we wanted. So I figured that some sort of PowerShell script was probably the way to go and it turned out to be even easier than I thought. The following script did it in one line, so I thought I would post it here in my "online memory". :) dir "\\sharepoint\client documents" | where {$_.PSIsContainer} | % {mkdir "\\sharepoint\admin documents\$($_.Name)"} I use "dir" to get a listing from the source folder, pipe it through "where" to get only objects that are folders and then do a foreach (using the % alias) and call "mkdir". Get More from the original blog... |
| | |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Document controller | admin | 2010 Job Archive | 0 | 8th May 2010 04:32 PM |
| Documentation Manager - Online library administrator - Leading IT | admin | 2010 Job Archive | 0 | 8th April 2010 04:25 AM |
| Pricing Partners Incorporates the Portfolio Function into Price-It Library | Latest News Headlines | 2009 Q4 News Headlines | 0 | 24th December 2009 07:49 AM |
| PowerShell: List all the senders from an Outlook folder | Darren Gosbell | Random Procrastination | 0 | 23rd June 2009 08:30 PM |
| SSAS: Powershell to replace a group member in a role | Darren Gosbell | Random Procrastination | 0 | 23rd June 2009 08:30 PM |
| | |
| | |