title: Need help logging into remote computer and reading text file
body: <p>I have created a windows forms application which I want to use to connect to a remote computer and display
  data stored in a text file. However, when it attempts to connect to the remote computer I get the following error:</p>
  
  <p><strong>The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)</strong></p>
  
  <p>The code I am using to connect to the remote computer:</p>
  
  <pre><code> var conOpt = new ConnectionOptions();
          conOpt.Impersonation = ImpersonationLevel.Impersonate;
          conOpt.EnablePrivileges = true;
          conOpt.Username = "username";
          conOpt.Password = "password";
          var scope = new ManagementScope(String.Format(@"\\{0}\ROOT\CIMV2", "computername"), conOpt );
  
          scope.Connect();
  </code></pre>
  
  <p>After researching this on the net, it seems that the application may not be
   allowed to connect because of firewall settings on the server or related to ports. Or perhaps I'm missing something in the code?</p>
  
  <p>Could this be related to the group policy on the remote computer to
   allow specific applications to connect? What else needs to be taken into account in terms of configuration? Is there a better way of doing this?</p>