MSDeploy.exe can connect as Administrator, but not any other Windows account

后端 未结 6 1808
情话喂你
情话喂你 2021-02-02 15:37

I\'m integrating MSDeploy into my build process, and having problems authenticating. The following command works fine:

msdeploy -verb:sync -source:appHostConfig         


        
相关标签:
6条回答
  • 2021-02-02 16:15

    Figured It Out!

    So, it seems that (at least by default), WMSVC only listens on HTTPS, and HTTP will just time out. However, since my certificate was self-signed, I had to use the -allowUntrusted command line option.

    That was almost enough. I also had to specify authType=Basic like Richard originally suggested. So, to put it all together, this is the MSDeploy command line that will actually work:

    msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=https://192.168.0.3:8172/msdeploy.axd,authType=Basic,userName=Publish,password=secret -dest:package=c:\DeployTest\KPC.zip -allowUntrusted
    
    0 讨论(0)
  • 2021-02-02 16:20

    (Updated 2016-03-07 - NOTE: non-Administrator deployments also require ?site=IIS_SITE_NAME after msdeploy.axd, otherwise the connection is treated as global and requires Administrator access)

    Not sure how missed this originally, but your problem is the computerName parameter. Non-administrator deployments are only supported when using WMSVC, for which you need to specify the full URL.

    Try the following

    msdeploy -verb:sync ^
      -source:appHostConfig="KitchenPC",computerName=https://192.168.0.3:8172/MsDeploy.axd,userName=kpcpublish,password=secret,authType=Basic ^ 
      -dest:package=c:\DeployTest\KPC.zip 
    

    From the docs:

    The computer name will be translated to the default Web Deploy URL. For example, computerName=Server1 will become http://Server1/MsDeployAgentService. If the remote service is running with a custom port or URL, you must specify the full URL

    And from the install instructions:

    The MSI will not install the Web Management Service handler component if the Web Management Service is not installed; the handler component is necessary for non-administrator deployments

    (I couldn't find a more explicit canonical source that describes WMSVC as a requirement for non-admin deployments)

    0 讨论(0)
  • 2021-02-02 16:24

    After configuring Web Deploy my server as follows. I continued to get HTTP 404 connection failures. In may what worked for me was the following additional efforts...

    1. Uninstall all previous version of Web Deploy that existed. I was not even aware they existed; however, previous versions appear to conflict with completing a connection to the latest Web Deploy service. Newer version don't uninstall their predecessors. In the last part, I was getting HTTP 401.7 - File Extension Denied.
    2. For good measure, performed a repair of the current version of Web Deploy, currently Microsoft Web Deploy 3.6
    3. For good measure, recreate and import my Visual Studio 2013 deployment profile...
      1. recreate the publish settings file using the Configure Web Deploy Publishing dialogue available from the Deploy context menu option of the target website in IIS Manager's Connections panel. (Note, the publish settings file will be recreated when you press Setup as the file whose full path is specified in the dialogue entry, Specify a location to save the publish settings file)
      2. Copy or otherwise make the publish settings file available to Visual Studio and selecting Publish from your project's context menu, create a Visual Studio publish profile by importing the publish settings file.
    0 讨论(0)
  • 2021-02-02 16:32

    Try restarting the wmsvc service on the target machine

    0 讨论(0)
  • 2021-02-02 16:40

    As alluded to above, make sure that you are connecting over HTTPS. If you are attempting to connect as Admin, but not using SSL, you get the following error:

    Error Code: ERROR_USER_NOT_ADMIN

    More Information: Connected to 'host' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'host'.

    (Where 'host' is your server name)

    0 讨论(0)
  • 2021-02-02 16:40

    For me the problem was that my password expired... I've noticed it when loging out and then tried to login back trhough remote desktop.

    0 讨论(0)
提交回复
热议问题