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
Try listening semi-synchronously with WaitForNextEvent():
var managementScope = new ManagementScope(@"\\mysever\root\onguard");
managementScope.Connect();
var query = new EventQuery("select * from lnl_AccessEvent");
var eventWatcher = new ManagementEventWatcher(managementScope, query);
var wmiEvent = eventWatcher.WaitForNextEvent();
Console.Out.WriteLine(wmiEvent.GetPropertyValue("Description"));
We've also found wbemtest.exe useful. Click the Notification Query... button to listen for events. You can try the various connection methods (synchronous, asynchronous or semi-synchorous). All connection methods work when connecting to your local machine but we were only able to get semi-synchronous to work remotely. Asynchronous (which you are using) is more complex (and less secure) because the server must make a connection back to the client.
Some good information here on security and configuration settings: http://www.packettrap.com/network/Knowledge-Base/PacketTrap-MSP/WMI-Troubleshooting.aspx#_Toc239699682