I am trying to get notification from a remote machine \'s event viewer using WMI and C#. I am able to connect the system and also get event log by using ManagementObje
I spent hours figuring this one out. None of the above worked for me.
After analyzing the Event logs on my IIS server I found I was receivingthe following error event in the System Log every time I called the Start method on the ManagementEventWatcher object:
The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {49BD2028-1523-11D1-AD79-00C04FD8FDFF} and APPID {49BD2028-1523-11D1-AD79-00C04FD8FDFF} to the user IIS APPPOOL\DefaultAppPool SID (S-1-5-82-3006700770-424185619-1745488364-794895919-4004696415) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.
A registry search revealed that the application with the APPID specified in the error was
Microsoft WBEM Unsecured Apartment
To make the asynchronous callback work you need to grant Local Activation permissions on the this COM object to the IIS APPPOOL\DefaultAppPool user, which sounds easy enough except for the fact that user does not show up as a valid acount in the security database. This is because it is a system generated user account automatically built when an IIS Application Pool is created.
The process to make this work is as follows: