Tuesday, 15 September 2015

Creating Lookup column from Visual Studio 2012/2013

How to add the lookup column from the Visual Studio 2012 /2013 UI.

  1. Create the lookup column in the Visual Studio UI like below

  2. Go to the properties of the column(select column and press F4) and update the List and ShowField properties with the Target List URL and Column Name to be targeted.

Friday, 11 September 2015

Host Named Site Collection

Host-named site collections enable you to assign a unique DNS name to site collections for example http://MysiteA1.sharepoint.com. 

Host-named site collections can be created only through the Powershell command.


$web= Get-SPWebApplication "http://webApplication URL under which HNSC needs to be created"

New-SPSite "http://MySiteA1.Sharepoint.com" -OwnerAlias "Domain\UserName" -HostHeaderWebApplication $web -Name "MySiteA1"

This should ideally create your Host Named Site Collection. 

Sometimes it may give a warning on the powershell window like below



WARNING: The port specified for the new host header site does not match any known bindings in the specified Web Application. The new site will not be accessible if the Web Application is not extended to an IIS Web Site serving this port.


  1. Go to IIS Manager (type inetmgr from Run)
  2. Find the web application to which we have added the site collection.Right click on it and select Bindings


  3. Click "Add"  bindings to make an entry
  4. Click OK
  5. Open hosts file.(Type drivers from Run, within etc folder)
  6. Add an entry to the hosts for the site collection like below
  7. You will be able to browse your site after giving the URL(You may need to select the template). 
NOTE: If you are prompted credentials  again and again without allowing you login then you will have to disable loop back checking


Disabling Loop Back checks


When you use the fully qualified domain name (FQDN) or a custom host header to browse a local Web site that is hosted on a computer that is running Microsoft Internet Information Services (IIS) 5.1 or a later version, you may receive an error message that resembles the following:
HTTP 401.1 - Unauthorized: Logon Failed
This issue occurs when the Web site uses Integrated Authentication and has a name that is mapped to the local loopback address.

Note You only receive this error message if you try to browse the Web site directly on the server. If you browse the Web site from a client computer, the Web site works as expected.


  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer.