Tuesday, March 31, 2015

What is Robots.txt?

What is robots.txt?

The robots exclusion protocol (REP), or robots.txt is a text file webmasters create to instruct robots (typically search engine robots) how to crawl and index pages on their website.

Cheat Sheet

Block all web crawlers from all content
User-agent: * 
Disallow: /
Block a specific web crawler from a specific folder
User-agent: Googlebot 
Disallow: /no-google/
Block a specific web crawler from a specific web page
User-agent: Googlebot 
Disallow: /no-google/blocked-page.html
Sitemap Parameter
User-agent: * 
Sitemap: http://www.example.com/none-standard-location/sitemap.xml

Monday, March 30, 2015

Create Site Collection in a Specific Content Database

In real world scenarios you will have to store or create sitecollection into a separate content Database. For example if you have a large number of team sites which may increase in numbers and leads to the size in future to 500GB to 1TB or even more. So you need to create additional content databases for a particular web application.
Example: If you are building portal for a customer and his company have different departments like Finance, marketing, Sales etc. Where you need to store more amount data, in those cases you need to create multiple content databases in a single web application.
Try to use below naming conventions to maintain the databases in a long term prospective for SQL guys who are maintaining your SharePoint databases.
For finance team "Finance_Team_site_Content_Database" , for marketing "Marketing_Team_site_Content_Database" and for Sales "Sales_Team_site_Content_Database" etc.
To achieve our goal perform below steps.

Step 1: Add content Database to web application:

From Central administration screen and under "Application Management" click on Manage Content Databases”.
Click on "Add a Content database".
For example enter Database Name as "Finance_Team_site_Content_Database" under "Database Name and Authentication section" in "Add a Content database" section, leave remaining fields as it is and click ok.
The field Database Capacity Settings can be used, if you want to limit how many sitecollections you can create in a particular content database and give a warning message to the end user while creating the content database.
Please see the below Figure :Add Content Database to add the content database.
Add Content Database
Figure:Add Content Database
For each content Database you add from central administration it will create a database in SQL server.
You can check if you have access to it or ask your SQL DBA if it’s managed environment, if it is a local VM then its up to you :) you can test whatever you want.
Add few more content databases for testing. I have added four content databases here. "Finance_Team_site_Content_Database", "Marketing_Team_site_Content_Database", "Sales_Team_site_Content_Database" and "SharePoint_Journey_2013_Content_Database".
If i create a new site collection from the central administration screen I want to store or create site collection need to store in a particular Content Database, this is our goal correct. 
Let’s say I want one Team site template sitecollection for SharePoint-Journey Sales, when I create a site collection with the name of SharePoint-Journey sales it has to store in "Sales_Team_site_Content_Database" content Database.
You can see Database status field in the Figure: Content Databases List shows as started for all the databases.
Content Databases List
Figure: Content Databases List

Step 2: Manage Content database settings:

Before creating sitecollection you have to change the status of each content database status to stopped and only required content database should show started. In our example "Sales_Team_site_Content_Database" content database should be started.
See the below Figure:Database settings , click on all Database names and change Database status from ready to offline except "Sales_Team_site_Content_Database" and click ok. 
Database settings
Figure:Database settings
You can see the Figure : Content Databases where only one database status is Started all other remaining are in Stopped status and oberve the "Current number of site collections" against the "Sales_Team_site_Content_Database" is zero.
Content Databases
Figure :Content Databases

Step 3: Create sitecollection:

In the final step we will create sitecollection and try to find in which Content Database it will get stored.
Please use post on how to create a sitecollection in SharePoint 2013. After creating a site collection go to manage Content Databases under Application management section, you can see that "Current number of site collections” is showing "1" against "Sales_Team_site_Content_Database" content Database. See the below Figure. Content Databases
Content Databases
Figure.Content Databases.
After completion of above steps don’t forget to change the other databases settings to Ready i.e. started. To change the status click on Database name and change Database status from offline to ready and click ok. Repeat this step for all the Content databases those are offline.
Congratulation you have completed all the required steps.
Before concluding the topic, one question here is what will happen if you change the status from Ready to offline?.
The answer is during offline You can open the sites in that particular content database but write operation are not possible.


You have created  a site collection successfully in specific content databases from list of content databases that are attached to the web application.

Tuesday, March 24, 2015

SharePoint 2013: Claims Encoding - Also Valuable for SharePoint 2010

SharePoint 2013: Claims Encoding - Also Valuable for SharePoint 2010

SharePoint 2013 and SharePoint 2010 display identity claims with the following encoding format:
<IdentityClaim>:0<ClaimType><ClaimValueType><AuthMode>|<OriginalIssuer (optional)>|<ClaimValue>
  • <IdentityClaim> indicates the type of claim and is the following:
    • i” for an identity claim
    • c” for any other claim
  • <ClaimType> indicates the format for the claim value and is the following:
    • #” for a user logon name
    • .” for  an anonymous user
    • 5” for an email address
    • !” for an identity provider
    • +” for a Group security identifier (SID)
    • -“ for a role
    • %” for a farm ID
    • ?” for a name identifier
    • "\" for a private personal identifier (PPID)
    • "e" for a user principal name (UPN)
  • <ClaimValueType> indicates the type of formatting for the claim value and is the following:
    • .” for a string
    • +” for an RFC 822-formatted name
  • <AuthMode> indicates the type of authentication used to obtain the identity claim and is the following:
    • w” for Windows claims (no original issuer)
    • s” for the local SharePoint security token service (STS) (no original issuer)
    • t” for a trusted issuer
    • m” for a membership issuer
    • r” for a role provider issuer
    • f” for forms-based authentication
    • c” for a claim provider
  • <OriginalIssuer> indicates the original issuer of the claim.
  • <ClaimValueType> indicates the value of the claim in the <ClaimType> format.
Here are some places in SharePoint where you will see claims encoding (please add to this list):
  • In the display of user sign-in information on a SharePoint 2010 or 2013 web site (For example, on a SharePoint 2013 team site page, click your user name in the upper-left corner, and then click My Settings. The Accountfield uses the claims encoding.)
  • In the "Authentication Authorization" log entries in the Unified Logging Service (ULS) log files for SharePoint 2013
  • In the audit log under the User ID field

 Here are some examples (please add your own based on your experience):
Type of claim
Encoded claim
Claim encoding breakdown
Windows User
  • “i” for an identity claim
  • “#” for the user logon name  format for the claim value
  • “.” for a string
  • “w” for Windows claims
  • “contoso\chris” for the identity claim value (the Windows account name)
Windows Authenticated Users group
  • “c” for a claim other than identity
  • “!” for an identity provider
  • “.” for a string
  • “s” for the local SharePoint STS
  • “windows” for the Windows Authenticated Users group
SAML authentication (Trusted User)
  • “i” for an identity claim
  • “5” for the email address format for the claim value
  • “.” for a string
  • “t” for a trusted issuer
  • “adfs” identifies the original issuer of the identity claim
  • “chris@contoso.com” for the identity claim value
Forms-based authentication
  • “i” for an identity claim
  • “#”for the user logon name  format for the claim value
  • “.” for string
  • “f” for forms-based authentication
  • “mymembershipprovider” identifies the original issuer of the identity claim
  • “chris” for the user logon name

Wednesday, March 18, 2015

SharePoint disable loopback check (DisableLoopbackCheck dword in registry)

SharePoint disable loopback check (DisableLoopbackCheck dword in registry)

I have found this very handy.. recently, I was working on a server and we were trying to access the local SharePoint site or http://nameoflocalserver/pages/default.aspx and I was constantly prompted for the username and password. In SharePoint 2010, it can really annoy you by not accepting your username password credentials in the popup window.

Its a ‘feature’ on the server that you need to disable as a workaround (if you are an Admin/Developer) on a DEVELOPMENT and PREPROD environment.
Caution: Microsoft Best practices is out of scope in this article. Do your own research on this topic.

There are two methods to do this:
1.  Specify the host names in the registry – BackConnectionHostNames (more secure and recommended for PRODUCTION servers). Refer http://support.microsoft.com/kb/896861

2. Disable the loopback check – DisableLoopbackCheck (less secure and recommended for DEVELOPMENT environments). Read on to use this method 2 and add via an easy powershell cmd.

You would need to create a DWORD registry key in the registry called DisableLoopbackCheck and set it to 1.
Follow these steps:

Option 1: Add this registry entry by PowerShell

New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -value "1" -PropertyType dword
Option 2: Add this registry entry manually

Click Start, click Run, type regedit, and then click OK
In Registry Editor, locate the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Right-click Lsa, point to New, and then click DWORD Value. (In Win 2008, its DWORD 32bit)
Type DisableLoopbackCheck, and then press ENTER.
Right-click DisableLoopbackCheck, and then click Modify.
In the Value data box, type 1 and then click OK.
Quit Registry Editor.
You may need to restart your server.

For more information about this, click the following article number to view the article in the Microsoft Knowledge Base: 281308 (http://support.microsoft.com/kb/281308/ ) Connecting to SMB share on a Windows 2000-based computer or a Windows Server 2003-based computer may not work with an alias name

Google+ Followers