Enable "Alternate Languages"for all sites below the SharePoint web application

1996 단어 application
clear
 
$PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
$webAppUrl = Read-Host
$WebApp = Get-SPWebApplication $webAppUrl
Foreach ($SiteColl in $WebApp.Sites)
{
    $rootSite = Get-SPSite $SiteColl.Url
    $allWebs = $rootSite.AllWebs
    foreach ($web in $allWebs)
    {
        Write-Host "Updating ” + $web.Title + " " + $web.Url
        if ($web.IsMultilingual -eq $false)
        { $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.Close()
        $web.Dispose()
    }
}

좋은 웹페이지 즐겨찾기