David Kitchen

Avatar

Just another SharePoint developer blogging

Impersonating a user in C#

A random tech post, I just know I'm going to need this again sometime and this is my web notepad. This is some code, to impersonate another user using calls to unmanaged code, and then to loop some Sharepoint lists as the impersonated user and then go back to the user of the process. using System; using System.Runtime.InteropServices; using System.Security.Principal; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Utilities; namespace ConsoleApplication1 { class Class1 { ...

,