title: Connect to TfsTeamProjectCollection using WindowsCredentials
body: <p>I want to connect to TfsProjectCollection using the same credentials I use to login to windows. Is this even possible?</p>
  <p>I am connecting now with alternative credentials having this code:</p>
  <pre class="lang-cs prettyprint-override"><code>NetworkCredential credential = new NetworkCredential(this._username, this._password);
  VssBasicCredential basicCred = new VssBasicCredential(credential);
  try
  {
      _tfsDataConnection = new TfsTeamProjectCollection(new Uri(this._tfsLink), basicCred);
  
      // VssData Part
  
      Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
      var url = new Uri(_tfsLink);
  
      VssCredentials vsc = new VssCredentials(new Microsoft.VisualStudio.Services.Common.WindowsCredential(
          new NetworkCredential(this._username, this._password)));
      VssConnection connection = new VssConnection(url, vsc);
  
      _vssDataConnection = connection.GetClient&lt;BuildHttpClient&gt;();
  }
  </code></pre>
  <p>I will need to get Builds and Projects from that server.</p>
  <p>This is what i tried but I get an error as like I am not authorized.</p>
  <pre class="lang-cs prettyprint-override"><code>_tfsDataConnection = new TfsTeamProjectCollection(new Uri(this._tfsLink));
  try
  {
      VssCredentials vsc = new VssCredentials(new Microsoft.VisualStudio.Services.Common.WindowsCredential(CredentialCache.DefaultNetworkCredentials));
      VssConnection connection = new VssConnection(new Uri(_tfsLink), vsc);
      _vssDataConnection = connection.GetClient&lt;BuildHttpClient&gt;();
  }
  </code></pre>