Enable ECB menu on non-default column – SharePoint Server 2013

Once in a while you will get this requirement where users want to enable ECB menu on a column which is not default column. E.g. in case of Custom list you want to display ECB menu option on say your own column and not on Title column.

One way to achieve this is by using the following PowerShell script.

One word of caution please make sure you do not enable ECB menu on person or group field type.  For some reason SharePoint does not like that. In case you ran this script on Person or Group field type then simply revert  it and you would get your field data back,.

Here is the script.

Add-PSSnapin Microsoft.SharePoint.PowerShell

$web = Get-SPWeb "http://intranet.contoso.com/";

$list = $web.Lists["LISTTITLE"];

$field = $list.Fields["COLUMN"];

$field.ListItemMenu = $true;

$field.LinkToItemAllowed = [Microsoft.SharePoint.SPField+ListItemMenuState]::Required;

$field.ListItemMenuAllowed = [Microsoft.SharePoint.SPField+ListItemMenuState]::Required;

$field.Update();

$list.Update();