The "Sign in as Different User" is a bad idea for a lot of reasons, but the two biggest are:
- Security on the computer where "User B" wants to access SharePoint. While at this computer they could perform any number of actions as "User A".
- Mixed experiences when using software other than a browser. As an example, "User B" can "Sign in as Different User" on the "User A" computer. Everything done from the browser, such as adding list items, is logged as "User B", but many actions performed from Word, Outlook and other tools will be logged as "User A"
"Sign in as Different User" is available from the Welcome menu and from the Access Denied page:
How a Site Owner can hide "Sign in as Different User"
Note: You can still "Sign in as Different User" by navigating directly to the Access Denied page:
How a developer or server administrator can hide "Sign in as Different User"
As there are two ways a user can get to the "Sign in as Different User" option you will need to make two different changes, one to the Welcome menu and one to the Access Denied page.
- Changes to ControlTemplates and Layouts folder impact all users on all sites in the farm!
- Changes to the pages in the ControlTemplates and Layouts folder need to be documented as farm rebuilds or service pack updates could overwrite your changes.
- You should make a backup copy of any files you edit.
- All changes must be made identically on all web front end servers.
Updating the Welcome menu
The Welcome menu is implemented as an ASPX user control (.ascx) and is stored in the …\14\TEMPLATE\CONTROLTEMPLATES folder. Editing this file impact all users on all sites in the farm. You may want to use the "Site Owner" solution listed earlier in this article. Another option is to create a copy of the Welcome.ascx file and modify selected master pages to point to the custom version of the file.
- Open the Welcome.ascx file (or your custom copy) using Notepad or Visual Studio from
- Find the MenuItemTemplate with the ID of ID_LoginAsDifferentUser
- Then do one of the following
- Delete the MenuItemTemplate control
- Add these two options to the MenuItemTemplate control to limit the display of the menu item to only Site Owners
Updating the Access Denied page (AccessDenied.aspx)
- Open the AccessDenied.aspx page using Notepad or Visual Studio:
- Find the following code:
- Then do one of the following:
- Delete the code
- Wrap the code in a comment block
- Wrap the code in a SPSecurityTrimmedControl with a permission level such as ManageWeb (see this article) so Site Owner can still see the option.
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManageWeb"><asp:HyperLink id="HLinkLoginAsAnother"