I need to hide the "Sign In as Different User" option on the "Welcome" menu for all users. This is for SharePoint 2010. I have tried adding a customaction feature using the xml below, which didn't work. I heard a rumor that this is a known issue, so I then tried adding the javascript below to the bottom of the body tag in v4.master.
The HideCustomAction does not seem to work for any of the Welcome menu items, but the javascript works fine for "PersonalizePage" and "PersonalInformation," which I am also hiding. I have condidered jQuery, but suspect it might have the same issue, which is the inability to consistently find the "LoginAsDifferentUser" menu item.
The only thing I saw work was putting the javascript into a CEWP, but it worked the first time I tried it, then quit working.
Any help is greatly appreciated. TIA
Elements.xml:
<HideCustomAction
GroupId="PersonalActions"
Id="LoginAsDifferentUser"
Location="Microsoft.SharePoint.StandardMenu">
</HideCustomAction>
javascript:
<script type="text/javascript">
var objects = document.getElementsByTagName("ie:menuitem");
for (var i = 0; i < objects.length; i++) {
itm = objects[i];
if (itm.id.match("LoginAsDifferentUser") != null) {
var parentNodeOfMenuItem = itm.parentNode;
parentNodeOfMenuItem.removeChild(itm);
}
}
</script>