Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to deploy a .NET web application who's security is done using impersonation.

Writing to the eventlog works fine on my dev box (Win 2003 IIS6) but after putting the app on the live box (Win 2008 IIS7) i'm getting the following;

Access is denied [Win32Exception (0x80004005): Access is denied] [InvalidOperationException: Cannot open log for source 'MyApp'. You may not have write access.]
System.Diagnostics.EventLog.OpenForWrite(String currentMachineName) +1815151
System.Diagnostics.EventLog.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName) +452
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +463
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type) +30

The best help i've found on google has been; http://support.microsoft.com/default.aspx?scid=kb;en-us;323076 | http://msdn.microsoft.com/en-us/library/aa379570%28VS.85%29.aspx

The reference to; HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog\Application\CustomSD confuses me as i don't have this in the registry key on the live box.

Litle help??

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Even with impersonation it's possible that your app pool identity is used. Some apps RevertToSelf and don't honor the impersonation.

Process monitor from www.systernals.com will be your friend on this project. It's free and safe on a production server. Start it and reproduce the situation to get a capture. Then search for the word denied, or search for CustomSD or Eventlog. A pattern should emerge that will show which user is trying to gain access and how to grant that user access.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.