title: "Restore-SQLdatabase" Login failed for NT AUTHORITY\ANONYMOUS LOGON
body: <p>I have a powershell script for DB backup/restore. For some reason I am executing the script remotely using <code>new-pssession</code> and <code>invoke-command</code>. I am</p>
  
  <pre><code>1.connecting to remote server
  2.the local server is in a domain
  3.the remote server is in same domain
  4.Using the domain account which exist in both the machine and have admin rights.
  5.My SQL Service (I mean the instance/engine) is running with 
    the same Domain account
  </code></pre>
  
  <p>backup with command <code>Backup-SQLdatabase</code> succeeds but restore <code>Restore-SQLdatabase</code> failes 
  with error <code>Login failed for NT AUTHORITY\ANONYMOUS LOGON</code>.</p>
  
  <p>Just for trial/error I added "NT AUTHORITY\ANONYMOUS LOGON" to admin group in the machine where restore have to happen but no luck.</p>
  
  <p>Any clue what I am doing wrong (OR) how can I solve this problem.</p>
  
  <p>Appreciate your help.</p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT:</strong> will the <code>-SQLTrustedConnection</code> switch can solve this issue?</p>