简体   繁体   English

在 Windows Server 2016 上使用非管理员用户和 IIS 用户的 WebDeploy 出现 401 未授权错误

[英]401 Unauthorized error with WebDeploy using non-administrator user and IIS user on Windows Server 2016

I am getting 401 error when trying to deploy remotely.尝试远程部署时出现 401 错误。 Event log from server -来自服务器的事件日志 -

The following information was included with the event: 

IISWMSVC_AUTHORIZATION_SERVER_NOT_ALLOWED


Only Windows Administrators are allowed to connect using a server connection. Other users should use the 'Connect To Site or Application' task to be able to connect.

Process:WMSvc
User=deployer

I am using following script to deploy我正在使用以下脚本进行部署

msdeploy.exe -verb:sync -source:package=c:\Jenkins\workspace\Myproject.zip -   dest:auto,wmsvc=[server_ip],usernverame=iis_deployer,password=iis_deployer,authType=basic -setparam:name='IIS Web Application Name',value='Default Web Site\myproject\master' -allowUntrusted 

It works fine if I use the admin user.如果我使用管理员用户,它工作正常。 But it fails for non-admin and IIS users.但对于非管理员和 IIS 用户,它会失败。

I have tried to set the permission and delegated rules by following this article- https://blogs.iis.net/krolson/using-iis-manager-accounts-for-web-deployment-tool-msdeploy-delegation我尝试按照这篇文章设置权限和委派规则 - https://blogs.iis.net/krolson/using-iis-manager-accounts-for-web-deployment-tool-msdeploy-delegation

Nothing seems to work.似乎没有任何效果。

I have been struggling with this error for hours and I found the solution.我已经为这个错误苦苦挣扎了几个小时,我找到了解决方案。 In the MsDeploy.exe command line you must specify the site name in the "wmsvc" parameter.在 MsDeploy.exe 命令行中,您必须在“wmsvc”参数中指定站点名称。 For instance:例如:

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='d:\temp\xxx.zip' -dest:auto,wmsvc="https://192.168.XXX.XXX:8172/msdeploy.axd?site=Test",userName='usr',password='pwd',includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension  -AllowUntrusted -retryAttempts=2 -setParam:'IIS Web Application Name'='Test'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM