title: Web Deploy returns 401 unauthorized when publishing via [proj].deploy.cmd
body: <p>I'm having a bit of a problem with Web Deploy I just can't seem to iron out. Every time I try and publish to WMSvc via the [proj].deploy.cmd command in the package I'm getting "The remote server returned an error: (401) Unauthorized". The command looks like this (project is called "Web", server is named "AutoDeploy"):</p>
  
  <pre><code>Web.deploy.cmd /Y /M:https://AutoDeploy:8172/MsDeploy.axd -allowUntrusted
  </code></pre>
  
  <p>I can publish fine to <a href="https://AutoDeploy:8172/MsDeploy.axd">https://AutoDeploy:8172/MsDeploy.axd</a> via Visual Studio so the service is definitely running and I can successfully authenticate to it as administrator. Running this locally on the machine against the package while logged on as administrator (it's just a little local Win 2k8 VPC) isn't working and adding /U and /P parameters with the administrator account does nothing.</p>
  
  <p>I've <a href="http://technet.microsoft.com/en-us/library/ff729439%28WS.10%29.aspx">enabled failed request tracing</a> and am getting <a href="http://sites.google.com/site/troyahunt/fr000135.txt">this output</a> so at least there's something to refer to but unfortunately I can't determine what the root cause is. I'm trying to connect to the same service with the same credentials as in Visual Studio but obviously something is different.</p>
  
  <p>Just out of interest, I can publish fine to the Web Deployment Agent Service (MsDepSvc) as follows:</p>
  
  <pre><code>Web.deploy.cmd /Y /M:http://AutoDeploy/MsDeployAgentService /U:AutoDeploy\Administrator /P:...
  </code></pre>
  
  <p>But I really want to get WMSvc running! Any thoughts?</p>