Wednesday, July 13, 2011

All SharePoint site template are not supports Multilingual UI (MUI)!

While demonstrating new and cool SharePoint 2010 features to a customer, I wanted to show how easy it is to switch languages on SharePoint 2010 sites, but I was surprised by the following error message:
Figure 1. - This site is based on a site template that does not support alternate languages.
So it seems there are OOTB templates which do not support alternate languages (Supports Multilingual UI). I did some PowerShell magic and here is the list of SharePoint site templates and an indicator that shows if template supports Multilingual UI or not.
Name Title Supports Multilingual UI
GLOBAL#0 Global template
STS#0 Team Site
STS#1 Blank Site
STS#2 Document Workspace
MPS#0 Basic Meeting Workspace
MPS#1 Blank Meeting Workspace
MPS#2 Decision Meeting Workspace
MPS#3 Social Meeting Workspace
MPS#4 Multipage Meeting Workspace
CENTRALADMIN#0 Central Admin Site
WIKI#0 Wiki Site
BLOG#0 Blog
SGS#0 Group Work Site
TENANTADMIN#0 Tenant Admin Site
ACCSRV#0 Access Services Site
ACCSRV#1 Assets Web Database
ACCSRV#3 Charitable Contributions Web Database
ACCSRV#4 Contacts Web Database
ACCSRV#6 Issues Web Database
ACCSRV#5 Projects Web Database
BDR#0 Document Center
OFFILE#0 (obsolete) Records Center
OFFILE#1 Records Center
OSRV#0 Shared Services Administration Site
PowerPointBroadcast#0 PowerPoint Broadcast Site
PPSMASite#0 PerformancePoint
BICenterSite#0 Business Intelligence Center
PWA#0 Project Web App Site
PWS#0 Microsoft Project Site
SPS#0 SharePoint Portal Server Site
SPSPERS#0 SharePoint Portal Server Personal Space
SPSMSITE#0 Personalization Site
SPSTOC#0 Contents area Template
SPSTOPIC#0 Topic area template
SPSNEWS#0 News Site
CMSPUBLISHING#0 Publishing Site
BLANKINTERNET#0 Publishing Site
BLANKINTERNET#1 Press Releases Site
BLANKINTERNET#2 Publishing Site with Workflow
SPSNHOME#0 News Site
SPSSITES#0 Site Directory
SPSCOMMU#0 Community area template
SPSREPORTCENTER#0 Report Center
SPSPORTAL#0 Collaboration Portal
SRCHCEN#0 Enterprise Search Center
PROFILES#0 Profiles
BLANKINTERNETCONTAINER#0 Publishing Portal
SPSMSITEHOST#0 My Site Host
ENTERWIKI#0 Enterprise Wiki
SRCHCENTERLITE#0 Basic Search Center
SRCHCENTERLITE#1 Basic Search Center
SRCHCENTERFAST#0 FAST Search Center
visprus#0 Visio Process Repository
SRCHCENTERLITE#1 Basic Search Center
SRCHCENTERFAST#0 FAST Search Center
visprus#0 Visio Process Repository
The list above shows all templates installed with English SharePoint 2010 Enterprise + FAST. In case you want to check your own templates, use the following PowerShell code:


cls
if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
   Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
#English only templates
Get-SPWebTemplate | Where {$_.LCID -eq 1033} | Select Name, Title, SupportsMultilingualUI
Write-Host "=========================="
#All templates
Get-SPWebTemplate | Select Name, Title, SupportsMultilingualUI




Ref. by http://www.sharepointusecases.com

Schedule Crawl Start/Pause in SharePoint 2010 Search by PowerShell

In case of having not strong enough hardware there’s a pretty common request for start the crawl in the evening and pause in the next morning, before the work day starts. Scheduling the start of Full/Incremental Crawl is pretty easy from the admin UI, but you have to do some trick if you want to schedule the pause too. Here is my favorite trick: use PowerShell!
Here is what I do here:
  1. Create a script to start/resume the crawl (CrawlStart.ps1).
  2. Create a script to pause the crawl (CrawlPause.ps1).
  3. Schedule the script CrawlStart.ps1 to run in the evening (like 6pm).
  4. Schedule the script CrawlPause.ps1 to run in the morning (like 6am).
Is it simple, right? ;)

Here are some more details.
First, we have to know how to add the SharePoint SnapIn to PowerShell. Here is the command we need: Add-PSSnapin Microsoft.SharePoint.PowerShell.
Second, we have to get the Content Source from our Search Service Application:
$SSA = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"
$ContentSource = $SSA | Get-SPEnterpriseSearchCrawlContentSource -Identity "My Content Source"

Then we have to know how to check the status of this content source’s crawl: $ContentSource.CrawlStatus. Here are the available values:
  • Idle
  • CrawlStarting
  • CrawlingIncremental / CrawlingFull
  • CrawlPausing
  • Paused
  • CrawlResuming
  • CrawlCompleting
  • CrawlStopping
Finally, we have to know how to start/pause/resume the crawling:
  • Start Full Crawl: $ContentSource.StartFullCrawl()
  • Start Incremental Crawl: $ContentSource.StartIncrementalCrawl()
  • Pause the current crawl: $ContentSource.PauseCrawl()
  • Resume the crawl: $ContentSource.ResumeCrawl()

That’s it. Here are the final scripts:
1. CrawlStart.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell
    $SSA = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application" $ContentSource = $SSA | Get-SPEnterpriseSearchCrawlContentSource -Identity "My Content Source" if ($ContentSource.CrawlStatus  -eq "Idle" ) {         $ContentSource.StartIncrementalCrawl()     Write-Host "Starting Incremental Crawl" if ($ContentSource.CrawlStatus  -eq "Paused" ) {         $ContentSource.ResumeCrawl()     Write-Host "Resuminging Incremental Crawl" }
2. CrawlPause.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell
$SSA = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"
$ContentSource = $SSA | Get-SPEnterpriseSearchCrawlContentSource -Identity "My Content Source"
Write-Host $ContentSource.CrawlState
if (($ContentSource.CrawlStatus  -eq "CrawlingIncremental" ) -or ($ContentSource.CrawlStatus  -eq "CrawlingFull" )) {
        $ContentSource.PauseCrawl()
    Write-Host "Pausing the current Crawl"
    }

Write-host $ContentSource.CrawlState
And finally, you have to schedule these tasks as a Windows job, by using these actions: powershell –command “& ‘C:\Scripts\CrawlStart.ps1’” to start and powershell –command “& ‘C:\Scripts\CrawlPause.ps1’” to pause your crawl.
Ps.: These scripts work fine for FAST Content Sources in SharePoint too, in this case you have to use the FAST Content SSA.