首页 > 代码库 > 批量修改SharePoint2013 备用语言

批量修改SharePoint2013 备用语言

cls
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
foreach ($webApplication in Get-SPWebApplication) {
    Write-Host
    Write-Host "Processing $webApplication"
    Write-Host "******************************"
    
    foreach ($site in $webApplication.Sites) {
       
        $webs = $site.AllWebs
        Write-Host
        Write-Host "Processing $site"
        Write-Host "******************************"
        foreach ($web in $webs) {
                $Web.IsMultilingual = $true
 
                        $WebRegionSettings = New-Object Microsoft.SharePoint.SPRegionalSettings($Web)
                        Foreach ($lang in $WebRegionSettings.InstalledLanguages)
                        {
                            If ($Web.SupportedUICultures -notcontains $lang.LCID)
                            {
                                $Web.AddSupportedUICulture($lang.LCID)
                            }                    
                        }                       
          
            $web.Update()
            $web.Dispose()
            Write-Host $web.Url
        }
    }   
}