Authenticating against a remote server and domain (C#/3.5)
<p>I have a .Net 3.5 service that runs on a stand-alone computer. The service queries the event logs of servers in multiple Active Directory domains. I would like to authenticate to these using managed code. </p>

<p>Currently, I authenticate either with p/invoke to WNetAddConnection2A or with processing out with a net use. For example, this works:</p>

<pre><code>string user = "domain\\administrator";
string pass = "password";
string server = "server.domain.com";
string argument = String.Format("use \\\\{0}\\ipc$ /user:{1} {2}", server, user, pass);
System.Diagnostics.Process.Start("net.exe", argument);
System.Diagnostics.EventLog log = new EventLog("System", server);
</code></pre>

<p>Is there a way in the .Net 3.5 framework to authenticate and read the event log without having to proc out or call unmanaged code?</p>
