You can allow the Windows identity that runs MDrivenServer to write MDrivenServer exceptions to the Windows Event Log when the server log reports that Event Log writing is denied.
When you need this
MDrivenServer tries to write exceptions to the Windows Event Log. Windows can deny this operation when the account running the MDrivenServer process does not have sufficient permission for the Event Log registry key.
Check the MDrivenServer logs first. If they report that MDrivenServer cannot write to the Event Log, grant access to the identity that runs the process.
For example:
- If MDrivenServer runs in IIS under an application pool named
MDrivenServer, grant access toIIS AppPool\MDrivenServer. - If it runs as Network Service, grant access to
Network Service.
Do not grant access to an account unless that account is the identity used by the MDrivenServer process.
Grant Event Log access
Changing these permissions requires administrative access to the server.
- Open the Registry Editor:
- Select Start and then Run.
- Enter
regeditorregedt32.
- Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security. - Right-click the key and select Permissions.
- Add the Windows identity that runs MDrivenServer.
- Grant the identity the required access. For an IIS application-pool identity, select Modify under the Allow column.
- Select OK to save the permission changes.
The original guidance notes that permissions can be set on the broader Eventlog node. Apply permissions at the narrowest scope that solves the problem, in accordance with your server security policy.
Add an IIS application-pool identity
Use this procedure when MDrivenServer runs in an IIS application pool. For IIS context, see Documentation:IIS.
- In the Permissions dialog, select Add.
- In Enter the object names to select, enter
IIS AppPool\<your-app-pool-name>.- Example:
IIS AppPool\MDrivenServer
- Example:
- Select Check Names, then select OK.
- Select the added identity.
- Under the Allow column, select Modify.
- Select OK, then select OK again to close the dialogs.
Verify the change
- Reproduce the operation that previously caused the exception, or wait for the next applicable server exception.
- Check the MDrivenServer logs.
- Confirm that the earlier message about being unable to write to the Event Log no longer appears.
- Review Windows Event Log to confirm that the exception was recorded.
If access is still denied, verify that the identity you added is the identity that actually runs MDrivenServer. When MDrivenServer is hosted through IIS, check the application-pool configuration rather than assuming that it uses Network Service.
Security considerations
Registry permissions on Event Log keys affect Windows logging behavior. Grant permission only to the MDrivenServer process identity and only at the scope required by your environment. Coordinate changes with the administrator responsible for the server and its IIS configuration.
