Get the Application Pool Identity programmatically

p0enkie picture p0enkie · Apr 11, 2012 · Viewed 37.9k times · Source

How do I get the identity of an appPool programmatically in C#? I want the application pool user and NOT the user who is currently logged in.

Answer

adt picture adt · Apr 11, 2012

You could use System.Security.Principal.WindowsIdentity.GetCurrent().Name to identify the Identity in which the current application is running. This link provides a nice utility which displays the identity under which the aspx is run.