SharePoint 2013 Sign in as Different User Missing – Feature Based Solution
Sign in as different user menu option is missing in SharePoint server 2013, it has many possible workarounds which are explained in my earlier post: Sign in as Different User in SharePoint 2013 – Workarounds
How to add sign in as a different user in SharePoint 2013?
To enable sign in as a different user in SharePoint 2013, let’s build a feature-based solution using Visual Studio:
- Open Visual Studio 2013 (or 2012) >> Click on File >> New >> Project
- Choose: Office/SharePoint >> SharePoint 2013 – Empty Project. Name your solution and click on “OK”
- Enter the site for debugging and choose “Farm Solution” (Doesn’t matter even it’s a sandboxed solution too!) and click on the “Finish” button. Wait for Visual Studio to create the project structure.
- Now, in Visual Studio, Right-click the “Project” node from the solution explorer window, choose: Add >> New Item menu.
- Choose “Module” and give it a name. Click on Add.
- This module brings a feature “feature1” and “Sample.txt” File by default. Remove the sample.txt from the solution and rename Feature1 to something meaningful, I’ve made it the same as my project name – SignInAsDiffUser
- Update the elements.xml file with the below code
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="https://schemas.microsoft.com/sharepoint/"> <CustomAction Id="LoginAsDifferentUser" GroupId="PersonalActions" Location="Microsoft.SharePoint.StandardMenu" Sequence="1000" Title="Sign in as Different User"> <UrlAction Url="/_layouts/closeConnection.aspx?loginasanotheruser=true"/> </CustomAction> </Elements>
- Now, Right-click the Feature, “SignInAsDiffUser” from solution explorer and choose the “View Designer”menu item. On the feature designer page, give a name and description of your feature. Set the scope for the feature, I’ve made it: Site, So that it will be applicable for the entire site collection. Make sure the module we’ve created is included in the feature.
- Right-click the solution in Visual Studio, choose To deploy. This will automatically build, deploy, and activate your feature. Go to site collection features and make sure the “Sign in As different User” feature is activated.
Now, You’ll be getting a “Sign in As Different” user menu item under your personal settings menu in SharePoint foundation /Server.