Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;;en-us;323076 |

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
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 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


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.