Search code examples
msdeployhttp-status-code-401

msdeploy could not authorize when user is local admin


My msdeploy script is suddenly throwing 401 unauthorized errors after a password change on the my webadmin account. The script I'm using is:

msdeploy.exe -source:package='[MyPackage].zip' -dest:auto,ComputerName='[MyServer]',UserName='[MyWebAdminUser]',Password='[MyWebAdminPassword]',IncludeAcls='False',AuthType='Basic' -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted -retryAttempts=2 -setParam:'IIS Web Application Name'='[MyApp]'

In terms of trouble shooting:

  • The web admin account is a local admin on the target machine
  • All the appropriate accounts have full control of the target directories
  • I've checked the web management service settings (which haven't changed) and they appear to be correct
  • I've checked that my deploy script is unchanged

What else can I try?


Solution

  • Check the Web Deploy event log on the remote server to be sure, but it sounds like the password has expired for one of these three accounts: your admin user, WDeployAdmin or WDeployConfigWriter

    The WDeploy* users aren't meant to expire, but some domain policies enforce it. If it is indeed one of those, you might need to use my blog entry to reset the passwords in IIS: http://blog.richardszalay.com/2013/08/02/manually-creating-wdeployadmin-and-wdeployconfigwriter/