Friday, December 5, 2014

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 workaround which are explained in my earlier post:  Sign in as Different User in SharePoint 2013 - Workarounds

How to add sign in as different user in SharePoint 2013:
To enable sign in as different user in SharePoint 2013, Lets 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"
    sharepoint foundation 2013 sign in as different user
  • Enter the site for debugging and choose "Farm Solution" (Doesn't matters even its a sandboxed solution too!) and click on "Finish" button. wait for Visual studio to create project structure.
    how to add sign in as different user in sharepoint 2013
  • Now, in Visual studio, Right click the "Project" node from solution explorer window, choose Add >> New Item menu.
  • Choose "Module"and give it a name. Click on Add.
    sign in as different user menu option is missing in sharepoint server 2013
  • 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 as same as my project name - SignInAsDiffUser
    sign in with different user sharepoint 2013
  • Update the elements.xml file with the below code
      <?xml version="1.0" encoding="utf-8"?>
         <Elements xmlns="http://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 "View Designer"menu item.
  • In the feature designer page, Give a name and description to 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.
    add sign in as different user in sharepoint 2013
  • Right click the solution in visual studio, choose Deploy. This will automatically Build,deploy and active your feature. Go to site collection features and make sure "Sign in As different User"feature is activated.
    how to enable sign in as different user in sharepoint 2013
Now, You'll be getting "Sign in As Different" user menu item under your personal settings menu in SharePoint foundation /Server.
enable sign in as different user sharepoint 2013



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...