IIS 7 and Above
Enable IIS-Confguration Event Log through Registry key changes
Last post Oct 10, 2018 11:46 AM by innatus
Apr 18, 2014 06:01 PM|Northern|LINK
I need to enable IIS-Confguration Event Log (Event Viewer\Applications and Services Logs\Microsoft\IIS-Configuration, Operational) programmaticlly using C#. And I found that the registry key controls this setting is:
When I modify this key value, I can see that the Event Viewer's value changes correctlly. But unlike changing the setting from Event Viewer manually, no events appear in the log when I test it. Looks like that there is more needs to be done than just the
one registry setting. How should I do this?
I found an old thread opened 2 years ago with the same issue but without an answer to it:
Any input is highly appreciated
May 14, 2014 09:52 AM|Perkinsville|LINK
I am not 100% certain about this setting, but many changes to the Registry required at least a restart of the application pool. Others require an IIS Restart, an HTTP recycle or even a reboot.
Jun 22, 2015 11:03 AM|tweenet|LINK
Rather than editing the registry directly, you can run a process to make the change:
wevtutil.exe sl "Microsoft-IIS-Configuration/Operational" /e:true
There may even be an API for this, but I always use wevtutil.exe
Oct 10, 2018 11:46 AM|innatus|LINK
a restart of the application pool. Others require an IIS Restart, an HTTP recycle or even a reboot.
I have the similar issue on Windows Server 2016 and I restarted and rebooted the services and the machine but there is no Change!
Every time I call the "IIS-Configuration/Operational"-Log I get the following message:
"Event Viewer cannot open the Event log or custom view. Verify that Event Log Service is running or query is too long.
The instance name passed was not recognized as valid by a WMI data providor (4201)"
The Workaround is to disable an enable the Operational-Log again, than it is possible to view log-entries.
But what is the difference and how can I reliability set the Operational-Log functional via GPO?
Looking Forward to hear something new to this topic.