Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

EventLog Class and Machine Name (Connecting to remote machine eventlog).

$
0
0
Hi all,

I am trying to write to an EventLog on a remote machine and am getting an IOException stating "Network path not found". Now the computer name I am referencing can indeed be found and if I type a computer name such as "BLABLA" it takes forever to return however if I type in the computer name that is in my domain it returns almost instantly as if the computer is found but reports the above error. Also, I am able to connect to the remote computer's EventLog using my current credentials (I.E. not specifying a different user) through the Vista Event Viewer and "Connect to another machine" without any problem. Any ideas on why I am unable to connect to the same machine name but through the EventLog Class? Any help much appreciated. :)

Here is some of the code I am working with:

            if (!EventLog.Exists("Application", "REMOTEMACHINENAME")) //Exception here or any time I use an EventLog method that tries to reference the remote machine.  
            {  
                EventSourceCreationData srcData = new EventSourceCreationData("Taicho", "TaichoLog");  
                srcData.MachineName = "REMOTEMACHINENAME";
                EventLog.CreateEventSource(srcData);  
            }  
            EventLog log = new EventLog("TaichoLog", "REMOTEMACHINENAME","Taicho");  
            log.WriteEntry("Taicho says hi from his computer", EventLogEntryType.Information); 

Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>