Sharepoint Articles

Submit Article
Home » Articles » Sharepoint » GeneralRSS Feeds

Working with Impersonation in share point

Posted By: Destin Joy     Category: Sharepoint     Views: 2019

While working with share point there are several situations that we need to do impersonation. For example, while you work with site creation programmatically and you don't want to give full privilege to the user who does the same.In such Scenarios this small code be helpful to you

Before starting you have to use the below two name spaces

using System.Security.Permissions;

using System.Security.Principal;

Add the below two functions




Please call the function UseAppPoolIdentity() where ever you want to impersonate the user withadmin rights. When you finished with admin privileged operation just call t he second function  ReturnToImpersonatingCurrentUser().




Didn't find what you were looking for? Find more on Working with Impersonation in share point Or get search suggestion and latest updates.

Destin Joy
Destin Joy author of Working with Impersonation in share point is from Pathanamthitta, India. Destin Joy says

 Hello Everyone,

I am Destin Joy from India I have MCPD in SharePoint 2010, MCTS SharePoint 2010 application development and MCTS in SharePoint 2007. I am mostly working in  core part of SharePoint (2010-2007) and passionate about new Microsoft technologies. Born and brought up in Kerala You can reach me  @ Destin.Joy@hotmail.com


View All Articles

Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

No Comment Found, Be the First to post comment!