Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Monday, 10 February 2014

Disabling SharePoint 2010 mobile redirection


SharePoint 2010 has a mobile redirection feature that automatically redirects users accessing the SharePoint site from a mobile browser to the mobile view. While this redirection is useful for intranet sites it is not desirable for public internet sites with custom branding. There is no setting available in the site settings or central admin site to turn off the mobile redirection. To turn off the mobile redirection we need to modify the web.config to include browsercaps section with isMobileDevice flag to false.  The browser caps section should be added within the system.web element.

<browserCaps>

<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

<filter>isMobileDevice=false</filter>

</browserCaps>

Tuesday, 4 February 2014

Rename SharePoint 2010 Central Admin Content Database


When a SharePoint farm is setup it creates a content database for the central admin site with a default name SharePoint_AdminContent_<GUID>. There would be situations where the database has to be renamed to adhere to company naming policies or for better manageability using automated scripts. The process of renaming SharePoint 2010 content database can be achieved with few lines of PowerShell Script

Create a new content database for SharePoint central admin site

First step is to create a new content database for the SharePoint 2010 central admin site using the New-SPContentDatabase cmdlet

New-SPContentDatabase -Name <DatabaseName>     -WebApplication <URL of SharePoint central admin site>

Get GUID of the content database for SharePoint central admin site

Get-SPContentDatabase PowerShell cmdlet will give the name  and id of the content database.

The syntax is

Get-SPContentDatabase –WebApplication  <URL of Central admin site along with port number>

This will list the old content database and the new content database.Copy the GUIDs of the databases in notepad or similar application.

Move the sites from old content database to new

Get-SPSite cmdlet will give the sites in a content database and Move-SPSite cmdlet will move sites to a particular content database. We can use combination of these cmdlets to move the SharePoint 2010 central admin content database.

Get-SPSite –ContentDatabase {GUID of old content database} |

    Move-SPSite -DestinationDatabase {GUID of new content database}