Pages

Saturday, March 12, 2011

Remove Or Hide Sign in As Different User Option from Share Point

This article is useful for Remove Sign in as Different user From top Navigation.

Follow below steps for remove "Sign in as Different User"

Step 1 : Add Content Editor Web part

Step 2 : Copy below code

<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).attr("text") == "Sign in as Different User")
{
$('#' + itm.id).remove();
}
}

})
</script>

Step 3 : Save web part or web page.

Step 4 : Done.

Or

Step 1 : Alternate solution is copy welcome.ascx control and move to Create Custom Control folder and move that welcome.ascx control .

Step 2 : Remove Sign in as different user menu item.

Step 3 : Change Master Page through Share Point Designer

<%@ Register TagPrefix="wssuc" Tagname="Welcome" src="_controltemplates/Welcome.ascx" %>
and change to your Custom Welcome User control
<%@ Register TagPrefix="wssuc" Tagname="Welcome" src="_controltemplates/CustomUserControl /Welcome.ascx" %>

Step 4 : Save master page.

Some References:

http://aaclage.blogspot.com/2009/01/sharepoint-custom-welcome-control.html
http://www.sharepointoverflow.com/questions/8884/unable-to-hide-loginasdifferentuser-menu-in-sp2010



No comments:

Post a Comment