Hi,
Is there a way of determining the user login used for the Application Pool identity using the SharePoint API?
Thanks, MagicAndi
Hi,
Is there a way of determining the user login used for the Application Pool identity using the SharePoint API?
Thanks, MagicAndi
One way to do it - when you run your code with SPSecurity.RunWithElevatedPrivileges
, it is actually executed under the application pool's account. All you have to do is look at System.Environment.UserName
at that moment.
However, I believe there is a more elegant way to achieve this.