iis - WebDeploy (401) 未授权错误

标签 iis msbuild msdeploy webdeploy

尝试使用不是目标服务器上的本地管理员的 Windows 用户远程部署应用程序时,我使用 NTLM 身份验证从 MsDeploy 收到未经授权的错误。我在目标框中的管理服务委派中设置了规则,并选中了所有提供者。在此规则下,我添加了 2 个具有允许权限的用户('*',以及我正在执行远程部署的 Windows 用户)。此外,我已在我尝试部署的站点上授予 Windows 用户权限。如果我将 Windows 用户设置为目标框的本地管理员并设置“允许管理员绕过规则”,则部署工作正常。如果 Windows 用户不是本地管理员,则会出现以下错误:

Web deployment task failed.(Remote agent (URL http://xxxxxxxx/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.) Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator. Error details: Remote agent (URL http://xxxxx/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer. An unsupported response was received. The response header 'MSDeploy.Response' was 'V1' but 'v1' was expected. The remote server returned an error: (401) Unauthorized. in Microsoft.Web.Publishing.targets(3588, 5)

最佳答案

如果您将委派配置为“允许管理员绕过规则”并且 msdeploy 命令成功,那么您正在通过 WMSvc 并且它允许您通过。否则,从响应来看,WMSvc 似乎拒绝了您,而您将退回到 Web Deloy 代理。

将以下 reg 值设置/添加到 WMSvc reg 键:
reg add HKLM\Software\Microsoft\WebManagement\Server /v WindowsAuthenticationEnabled /t REG_DWORD /d 1
回收 WMSvc:
net stop wmsvc & net start wmsvc
再试一次。如果没有成功,您可以发布您的 msdeploy 命令行。

关于iis - WebDeploy (401) 未授权错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4807049/

相关文章:

node.js - iisnode 托管的 Web 应用程序能否计算出托管它的虚拟路径?

javascript - 允许子域之间的跨站点请求而不更改第二个子域的文件内容

iis-7 - MSDeploy 仅将配置从 IIS 6 迁移到 7

visual-studio-2010 - MSBuild 目标,BeforeCompile,在加载项目文件时触发

c++ - 在 vcxproj 中使用#include 与 ClInclude

.net - 将 SqlCmd 变量与 MsDeploy 的 dbDacFx 提供程序一起使用

msbuild - VS2010构建部署包+sectionGroup/自定义设置+SetParameters.xml

c# - 超出存储分配。服务器响应为 : 5. 3.4 消息大小超过固定的最大消息大小

asp.net - 将查询字符串传递到 IIS 中的自定义错误页面

c# - 如何确定构建程序集的 MSBuild 版本?