1

My setup is like this.

Application

Site collection

Sites

Each new site is created with a given number of pre defined lists. Each list has a title.

Lists

We now have some thousand sites, and the need to change the title for "First list" has come. The problem is that it is only possible to do this through SP GUI by changing the sites one by one, which is very time consuming.

I guess there is a possibility to do this using PowerShell. Do anyone have any examples of this?

0

What you need to do is iterate through all web sites in all site collections and look for a list called "First List" and then change it's name. Here is an example:

Add-PSSnapin microsoft.sharepoint.powershell

$WebApp = Get-SPWebApplication "http://sharepoint"
if ($WebApp -ne $null)
{
    foreach ($site in $WebApp.Sites) 
    {
        foreach ($web in $site.AllWebs) 
        {
            $list = $web.Lists["First List"];

            if ($list -ne $null)
            {
                $list.Title = "New Title";
                $list.Update();
            }            
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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