I am working with a SharePoint site, there are about 2500 folders in question, and I need to add a new sub-folder within each of them with the same title. Other than creating this new sub-folder in each of these folders one at a time, what are my options to automate/add this folder in bulk?
Get-PnPFolder -List "Relationships" | foreach-object { $newFolderPath = $_.ServerRelativeUrl.Replace("/sites/deploytarget/","") + "/YYY"; Resolve-PnPFolder -SiteRelativePath $newFolderPath}
Install-Module -Name PnP.PowerShell
Then I connect to the target SharePoint Site Collection (which is not necessarily the Root site collection):Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/deploytarget
In the site collection deploytarget I have a newly created document library named "Relationships". In there I created manually three folders.
first question: SharePoint On-Premises (if yes, which version) OR SharePoint Online?
second question: are all of these folders in one site / one document library?
Probably the best way would be using a PowerShell script - but depending on the SharePoint version either PnP-Powershell module (SharePoint Online) or some kind of SharePoint Client Object model in PowerShell.
E.g. for SharePoint Online:
Open in new window
(documentation)HTH and KR
Rainer