title: msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed. using IIS7, TFS2010, VS2012
body: <p>Using Visual Studio 2012, TFS 2010, IIS7</p>
  
  <p>Getting the following errors when I try to build/deploy:</p>
  
  <pre><code>Any CPU | Test
  1 error(s), 1 warning(s)
  
  C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets      
  (4253): Web deployment task failed. (Connected to the remote computer ("server1") using
  the Web Management Service, but could not authorize. Make sure that you are using the 
  correct user name and password, that the site you are connecting to exists, and that 
  the credentials represent a user who has permissions to access the site. Learn more 
  at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
  
  *snip warning*
  
  Other Errors and Warnings
  2 error(s), 0 warning(s)
  Building the projects in this solution one at a time. To enable parallel build, please 
  add the "/m" switch.
  TF270015: 'MSBuild.exe' returned an unexpected exit code. Expected '0'; actual '1'.
  </code></pre>
  
  <ul>
  <li>I verified the site exists in IIS </li>
  <li>I verified I have username and password correct (I'm able to log onto server) </li>
  <li>User is an admin on tfs server</li>
  </ul>
  
  <p>I don't have VS2012 on my tfs server, but someone copied their C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0 folder to the tfs server to fix another build issue a while back. I copied the same folder to "server1", did not change the error message.</p>
  
  <p>It still creates the build, just does not deploy.</p>