How to log msg in Remote machine event log...
-
Hi Guys, I can log msg in event log in my local computer. I want to do the same remotely... I find MachineName property in EventLog class, but didn't work... Your help could be useful. Following is my code snippet:
EventLog sysLog=new EventLog();
sysLog.MachineName="00C0D0C10F4A";
if(!EventLog.SourceExists("Application-1"))
EventLog.CreateEventSource("Application-1","SystemLog");EventLog.WriteEntry("Application-1","Hi",EventLogEntryType.Warning,235);
thax
Thanks, Chintan(India)
-
Hi Guys, I can log msg in event log in my local computer. I want to do the same remotely... I find MachineName property in EventLog class, but didn't work... Your help could be useful. Following is my code snippet:
EventLog sysLog=new EventLog();
sysLog.MachineName="00C0D0C10F4A";
if(!EventLog.SourceExists("Application-1"))
EventLog.CreateEventSource("Application-1","SystemLog");EventLog.WriteEntry("Application-1","Hi",EventLogEntryType.Warning,235);
thax
Thanks, Chintan(India)
Try to using WMI. It will be very easy !!
cheers, Abhijit