title: "A specified logon session does not exist. It may already have been terminated." when trying to copy a file using WindowsIdentity.Impersonate
body: <p>I am trying to copy a file from sharepoint to a unc path. I am using the following code:</p>
  
  <pre><code> var id = new WindowsIdentity("administrator@mysite.com");
   var p = new WindowsPrincipal(id);
   var wic = id.Impersonate();
   File.Move(oldName, newName);
   wic.Undo();
  </code></pre>
  
  <p>oldname is C:\test.txt
  newName is \\server\folder\test.txt</p>
  
  <p>I am getting the error</p>
  
  <pre><code>A specified logon session does not exist. It may already have been terminated.
  </code></pre>
  
  <p>How do I go about removing this error OR copy a file from A to B(UNC path) using sharepoint.</p>