EventLog Access using impersonation in Windows Server 2003

G

Guest

Issue
Our web application requires access to write to a custom event log, yet access is denied. This access is denied because we are using impersonation, and our end-users do not (should not) have permissions to write to a custom event log. We would like to know if someone out there has resolved this problem without incorporating registry hacks, elevating end-user account permissions to admin OR calling native code to logon as the account running our Application Pool

Ideally, we would like to use our Application Pool account identity to create the event log entries and we do not mind providing the necessary permissions to this accoun

Details
-Web App hosted on Windows 2003 serve
-Web App is using a custom application pool, running under a specified identity
-Web App uses its own (custom) event lo
-Web App uses impersonation, thus we loose the application pool identity when trying to create an event log entr
 
S

Steve C. Orr [MVP, MCSD]

Hopefully this link will provide your answer:
http://support.microsoft.com/?id=329291

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


cjk said:
Issue:
Our web application requires access to write to a custom event log, yet
access is denied. This access is denied because we are using impersonation,
and our end-users do not (should not) have permissions to write to a custom
event log. We would like to know if someone out there has resolved this
problem without incorporating registry hacks, elevating end-user account
permissions to admin OR calling native code to logon as the account running
our Application Pool.
Ideally, we would like to use our Application Pool account identity to
create the event log entries and we do not mind providing the necessary
permissions to this account
Details:
-Web App hosted on Windows 2003 server
-Web App is using a custom application pool, running under a specified identity
-Web App uses its own (custom) event log
-Web App uses impersonation, thus we loose the application pool identity
when trying to create an event log entry
 
B

bruce barker

try:

[DllImport("advapi32")] private extern static bool RevertToSelf();

WindowsIdentity id = WindowsIdentity.GetCurrent();
RevertToSelf();

// do your work here

id.Impersonate();


-- bruce (sqlwork.com)


cjk said:
Issue:
Our web application requires access to write to a custom event log, yet
access is denied. This access is denied because we are using impersonation,
and our end-users do not (should not) have permissions to write to a custom
event log. We would like to know if someone out there has resolved this
problem without incorporating registry hacks, elevating end-user account
permissions to admin OR calling native code to logon as the account running
our Application Pool.
Ideally, we would like to use our Application Pool account identity to
create the event log entries and we do not mind providing the necessary
permissions to this account
Details:
-Web App hosted on Windows 2003 server
-Web App is using a custom application pool, running under a specified identity
-Web App uses its own (custom) event log
-Web App uses impersonation, thus we loose the application pool identity
when trying to create an event log entry
 
S

Scott Zabolotzky

I'm having the same problem. Unfortunately the link provided does not
apply to my situation because I create the EventLog source in my
ASP.NET app installer. The problem is that even after the EventLog
source is created, my ASP.NET app can not log to the custom event
source when running under Windows Server 2003. It works fine under
Windows 2000.

Details:

ASP.NET app
impersonation=true in web.config
can not elevate user accounts to admin group just for logging

Any ideas? I've found several people asking for help with this
situation but no solutions offered.

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top