I just got an insane request dropped onto my desk. On our site we have a section with 15 subsites, each subsite has 5 libraries.

The request was to add a new view with a new column to all of the libraries. Is there anyway to apply the view to all the libraries at once? Or am I looking at a long "fun" project?

They currently have the same columns but the views are not linked as a template or anything (not my doing)

We are using SharePoint 2013 and SharePoint Designer 2013 Thanks

1 Answer 1


You can try the below powershell

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue

$siteURL = "http://sp14fdev01/"
$site = Get-SPSite($siteURL)

foreach($web in $site.AllWebs) {
  foreach($list in $web.Lists) {
    if($list.BaseType -eq "DocumentLibrary") {
// the variables `$web` and `$list` already reference the objects you need
      //$site = New-Object Microsoft.SharePoint.SPSite($SiteURL) ;
      //$web = $site.OpenWeb($SiteURL);

// new instance of the list is necessary to avoid the error "Collection was modified"
      $newList = $web.Lists.item($list.ID);

      $viewfields = New-Object System.Collections.Specialized.StringCollection 
      [void]$newList.Views.Add("Detailed", $viewfields, "", 100, $true, $true)


// setting the default view
      $view.DefaultView = $true




also check this:

How do I create a custom view and apply it to ALL document libraries on Sharepoint 2007 site

  • Finally getting back to this. It seems we don't have access to Powershell. Any other ideas on how to do this? Even if I had to rebuild all of the libraries so they had a shared/global view that could be updated later would be fine.
    – KurtH
    Commented Jul 10, 2015 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.