Search This Blog

Sunday, October 13, 2013

Enable Sign in as Different User Option in SharePoint 2013

In this post we are going to see how to enable the sign in as different user option in SharePoint 2013. Till SharePoint 2010 this option was by default available but in SharePoint 2013 for some reason this has been not visible by default.

so if you want this option to be available then you need to add following line of code to the welcome.ascx which is located at :\Program Files\Common Files\microsoft shared\Web ServerExtensions\15\TEMPLATE\CONTROLTEMPLATES.

Add this to the welcome.ascx file. But a note to consider, please take the backup of the welcome.ascx file before you attempt this step.

<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser" Text="<%$Resources:wss,personalactions_loginasdifferentuser%>" Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>" MenuGroupId="100" Sequence="100" UseShortId="true" />

And then you should have the sign in as different user option available.

Tuesday, October 1, 2013

On SharePoint, Hide the “Sign – in As A Different User” option through JQuery Or Other Options

A simple script you can add to your master page or content editor etc. to hide the “Sign in As a Different User” option that is available in the Personal Actions Menu.
<script src="/jQuery/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/JavaScript">
jQuery(document).ready(function($) {
var objects = document.getElementsByTagName("ie:menuitem");
for (var i = 0; i < objects.length; i++) {
itm = objects[i];
if (('#' + itm.id).indexOf("LoginAsDifferentUser") != -1) {
$('#' + itm.id).remove();
}
}
})
</script>
********************************************
Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES\
You there have a file call welcome.ascx and have action to  "LoginAsDifferentUser"
<SharePoint:MenuItemTemplate runat="server" id="ID_LoginAsDifferentUser"
                Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"
                Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
                MenuGroupId="100"
                Sequence="100"

                UseShortId="true"/>