[英]401 Unauthorized error with WebDeploy using non-administrator user and IIS user on Windows Server 2016
嘗試遠程部署時出現 401 錯誤。 來自服務器的事件日志 -
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
我正在使用以下腳本進行部署
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
如果我使用管理員用戶,它工作正常。 但對於非管理員和 IIS 用戶,它會失敗。
我嘗試按照這篇文章設置權限和委派規則 - https://blogs.iis.net/krolson/using-iis-manager-accounts-for-web-deployment-tool-msdeploy-delegation
似乎沒有任何效果。
我已經為這個錯誤苦苦掙扎了幾個小時,我找到了解決方案。 在 MsDeploy.exe 命令行中,您必須在“wmsvc”參數中指定站點名稱。 例如:
"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.