title: Powershell get file from server using NTLM auth
body: <p>I'm trying to get CSV file from a server with given url. Server with this file has NTLM authorization, and each time I try to use below code I get:  </p>
  
  <blockquote>
    <p>"The remote server returned an error: (401) Unauthorized."</p>
  </blockquote>
  
  <pre><code>$source = "http://sql-001.contoso.com/ReportServer/Pages/ReportViewer.aspx?test:Format=CSV&amp;rs:Command=Render"
  $destination = "C:\test.csv"
  $wc = new-object System.Net.WebClient
  $credCache = new-object System.Net.CredentialCache
  $creds = new-object System.Net.NetworkCredential("user","p@ssw0rd")
  $credCache.Add($source, "Basic", $creds)
  $wc.Credentials = $credCache
  $wc.DownloadFile($source, $destination)
  </code></pre>