SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I want to do is with a Powershell script programatically go through all subsites in a site collection and change a column name in a list from "Web" to "Site".

So in easier words: Go through subsites 1 2 3 4 5 6... Change a column name "Web" in a list to "Site".

Any help would be much appreciated!

share|improve this question

Have you tried something like this?

$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'} 

if ($snapin -eq $null) 
    Write-Host "Loading SharePoint Powershell Snapin"    
    Add-PSSnapin "Microsoft.SharePoint.Powershell"  -EA SilentlyContinue

$site = Get-SPSite http://portal

foreach ($web in $site.AllWebs)
    $lists = $web.Lists

    foreach ($list in $lists)
        foreach ($column in $list.Fields)
            if ($column.Title -eq "Web")
                $web.AllowUnsafeUpdates = $true
                Write-Host "Before change: " $web.Title
                $web.Title = "Site"
                Write-Host " After change: " $web.Title
                $web.AllowUnsafeUpdates = $false

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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