title: Permission error when trying to programatically connect to TFS 2010
body: <p>I'm trying to connect to TFS 2010 through the .Net <code>Microsoft.TeamFoundation.Client.TeamFoundationServer</code> class (in this case through powershell). </p>
  
  <p>I pass in for constructor arguments the same url that I connect to through visual studio, and my Active Directory credential obtained through <code>Security.Principal.WindowsIdentity.GetCurrent()</code>.  However when I call the <code>Authenticate()</code> method I get the following error (sub DOMAIN and USERNAME for my credentials).</p>
  
  <blockquote>
    <p>Exception calling "Authenticate" with
    "0" argument(s): "TF50309: The
    following account does not have
    sufficient permissions to complete the
    operation : (DOMAIN)\(USERNAME). The
    following permissions are needed to
    perform this operation: View
    collection-level information."</p>
  </blockquote>
  
  <p>So yes, I can go bug our sysadmin for whatever this permission is but I have no idea why I need it; after all, I can connect to TFS just fine via visual studio, or via the web interface (by suffixing the url with "/web") so what gives? What am I missing that I cannot authenticate programatically?</p>
  
  <p><strong>Extra Hint:</strong> We also have a TFS2008 server - following the exact same process I was able to authenticate to it with no problems</p>