title: MSDeploy.exe can connect as Administrator, but not any other Windows account
body: <p>I'm integrating MSDeploy into my build process, and having problems authenticating.  The following command works fine:</p>
  
  <pre><code>msdeploy -verb:sync -source:appHostConfig="KitchenPC",computerName=192.168.0.3,userName=Administrator,password=secret -dest:package=c:\DeployTest\KPC.zip
  </code></pre>
  
  <p>However, this does NOT work:</p>
  
  <pre><code>msdeploy -verb:sync -source:appHostConfig="KitchenPC",computerName=192.168.0.3,userName=kpcpublish,password=secret -dest:package=c:\DeployTest\KPC.zip
  </code></pre>
  
  <p>And yields the error:</p>
  
  <pre><code>Error Code: ERROR_USER_NOT_ADMIN
  More Information: Connected to '192.168.0.11' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administ
  rator on '192.168.0.11'.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
  Error: The remote server returned an error: (401) Unauthorized.
  Error count: 1.
  </code></pre>
  
  <p>I've followed the instructions in the link above, and any <a href="http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy" rel="noreferrer">other docs I could find</a>, which pretty much all say the same thing:</p>
  
  <ol>
  <li>I created an account called <em>kpcpublish</em></li>
  <li>I added this account to a group called <em>MSDepSvcUsers</em> - Heck, I even added the account to Administrators</li>
  <li>I right clicked on the site and selected <strong>Deploy->Configure Web Deploy Publishing</strong> and added kpcpublish to the list.  It says the following:</li>
  </ol>
  
  <p>.</p>
  
  <blockquote>
  <pre><code>Publish enabled for 'SERVER\kpcpublish' Granted 'SERVER\kpcpublish'
  full control on 'C:\Website' Successfully created settings file
  'C:\Users\Administrator\Desktop\SERVER_kpcpublish_KitchenPC.PublishSettings'
  </code></pre>
  </blockquote>
  
  <p>There <em>must</em> be some step I'm missing, but I just can't figure out what could be.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Using the full HTTP path for the <code>computerName</code> property, I get the error:</p>
  
  <blockquote>
    <p>Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could
    not connect to the remote computer ("192.168.0.3"). On the remote
    computer, make sure that Web Deploy is installed and that the required
    process ("Web Management Service") is started.  Learn more at:
    <a href="http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DES" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DES</a>
    TINATION_NOT_REACHABLE. Error: Unable to connect to the remote server
    Error: A connection attempt failed because the connected party did not
    properly respond after a period of time, or established connection fa
    iled because connected host has failed to respond 192.168.0.3:8192
    Error count: 1.</p>
  </blockquote>
  
  <p>I've checked and the Web Management Service is indeed running.</p>
  
  <p><strong>Another Update:</strong></p>
  
  <p>I've completely paved the system and set it up again from scratch.  I've done nothing out of the ordinary, just installed the IIS role and made sure to check "Management Service" under Management Tools, which is required for WMSVC to run.  I then installed Web PI, and installed "Recommended Configuration for Hosting Providers", which will install Web Deploy 3.0.  However, I did notice there was an error while installing this (I believe I got this error the last time as well).  It looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/wmuEA.png" alt="enter image description here"></p>
  
  <p>I've also attached the log files <a href="http://pastie.org/5089988" rel="noreferrer">here</a>.</p>
  
  <p>I then tried to install Web Deploy 3.0 manually, however it says it's already installed.  Next, I downloaded the MSI directly from <a href="http://www.iis.net/download/webdeploy" rel="noreferrer">http://www.iis.net/download/webdeploy</a> and ran it in "Repair" mode.  That seems to have worked.  I also noticed that the WMSVC service is up and running.  So this looks good.</p>
  
  <p>Still, MSDeploy will not connect.  I thought it might be some sort of firewall issue, so I ran it locally.  I've tried using both HTTPS and HTTP to connect.  HTTPS gives me an error, HTTP just times out after 2-3 minutes.</p>
  
  <p><strong>HTTPS:</strong></p>
  
  <pre><code>msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=https://STAGING:8172/msdeploy.axd,userName=Administrator,password=Khorf123 -dest:package=c:\DeleteMe.zip
  Info: Using ID 'f3a54096-adc4-4f54-9e4f-ad8fde12edb6' for connections to the remote server.
  Error Code: ERROR_CERTIFICATE_VALIDATION_FAILED
  More Information: Connected to the remote computer ("staging") using the specified process ("Web Management Service"), but could not verify the server's certifi
  cate. If you trust the server, connect again and allow untrusted certificates.
  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.
  Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
  Error: The remote certificate is invalid according to the validation procedure.
  Error count: 1.
  </code></pre>
  
  <p><strong>HTTP:</strong></p>
  
  <pre><code>msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=http://STAGING:8172/msdeploy.axd,userName=Administrator,password=Khorf123 -dest:package=c:\DeleteMe.zip
  Info: Using ID 'ebee66f0-08e5-4d9d-98ea-0c2e59784895' for connections to the remote server.
  Error: Could not complete the request to remote agent URL 'http://staging:8172/msdeploy.axd'.
  Error: The operation has timed out
  Error count: 1.
  </code></pre>