title: PSEXEC credentials delegation issue when running exe on remote machine
body: <p>I have a simple exe that just connects to SQL server and executes a <code>select</code> on a remote machine. In my scenario I have three machines: <code>A</code>,<code>B</code>, and <code>C</code>.</p>
  
  <p>I am ruining <code>PSExec</code> from machine <code>A</code> as below:</p>
  
  <pre><code>&amp; C:\PSTools\PSExec.exe \\MachineB C:\connectsql.exe -u username -p password
  </code></pre>
  
  <p>The exe, when executed on machine <code>B</code>, tries to connect to SQL server on machine <code>C</code> (based on the connection string I specified in the exe), which includes username and password as below:</p>
  
  <pre><code>"Data Source=machineC;Initial Catalog=AllDocs;Integrated Security=SSPI;User id=username;Password=pwd;"
  </code></pre>
  
  <p>Usernames and passwords are correct. But I get this error:</p>
  
  <pre><code>Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
  </code></pre>
  
  <p>But If I change the connection string in the exe to connect to SQL server on machine <code>B</code> itself, I do not see the issue.</p>
  
  <p>Also, If I run the exe locally on Machine B it successfully connects to SQL on Machine C.</p>
  
  <p>Any idea how I can get away with this issue, so that When <code>PSExec</code> runs on machine <code>A</code>, the exe from machine <code>B</code> should able to connect to sql on machine <code>C</code>?</p>