I need to figure out what account is being impersonated when I'm getting an access denied error running code under SharePoint 2010.
I inherited this project with almost no overlap in resources and not enough base knowledge to ask the right questions.
There is an aspx page deployed as part of a SharePoint solution that is attempting to create a directory on a file share, but cannot do so, with an exception caught that indicates access is denied. The method throwing the exception is run via a call to SPSecurity.RunWithElevatedPrivileges
(MethodName); Running the following code just before the creation attempt and printing the UserName
variable to a log indicates a service account that should have full control of the share
SecurityIdentifier user = System.Security.Principal.WindowsIdentity.GetCurrent().User;
String UserName = user.Translate(typeof(System.Security.Principal.NTAccount)).Value;
I need to know how to find the name of the account attempting the creation, and ideally, where to change it - I welcome all ideas! Thanks!