Code Q & A
  • index
  • Java
  • python
  • javascript
No Result
View All Result
Code Q & A
  • index
  • Java
  • python
  • javascript
No Result
View All Result
Code Q & A
No Result
View All Result

MSDeploy triggers 401 Access denied error when trying to synch a site

08/05/2022
in iis, msdeploy, msdeployserviceagent, ntlm
Reading Time: 3 mins read

I try to push/sync a IIS Site from a Win2003 Server to another.

This is my command:

msdeploy -verb:sync -source:metakey=lm/w3svc/68512112 -dest:metakey=lm/w3svc/68512112,computername=backup-09,username=Administrator,password=PASSWORD -whatif > msdeploysync.log

I also tried the following

msdeploy -verb:sync -source:metakey=lm/w3svc/68512112 -dest:metakey=lm/w3svc/68512112,computername=backup-09,username=BACKUP-09\Administrator,password=PASSWORD -whatif > msdeploysync.log

I also tried

msdeploy -verb:sync -source:metakey=lm/w3svc/68512112 -dest:metakey=lm/w3svc/68512112,computername=backup-09,[email protected],password=PASSWORD -whatif > msdeploysync.log

This is the error:

Fatal: Request to remote agent URL ''
failed.

Fatal: The remote server returned an error: (401) Unauthorized.
Fatal count: 1

  • I did run msdeploy/cmd as an
    administrator.
  • I did try to access
    ,
    it asked for my permissions, I
    entered the credentials above, it
    worked (empty site displayed).
  • This is Beta 2 of MSDeploy

Can anyone help me?

I now even set up a domain controller for all the servers... still the same issues, whether I'm logged in as a domain controller, supply the local accounts, all variations trigger a 401

Note that there is a bug in Web Deploy 2.0 (even the refresh) that does not allow users within the admin group to authenticate. Only domain admins and the administrator account itself can authenticate to web deploy. See the ERROR_USER_NOT_ADMIN error code on the following page:

Msdeploy appears to use NTLM authentication by default, even if userName and password are present. To enable the correct processing of "userName" and "password", append the following to the relevant source: or dest: parameters: ",authType=basic"

I got this error because UAC was turned on (Windows Server 2008).

Need to turn off UAC for remote connections:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\LocalAccountTokenFilterPolicy=1

This key helped me on another server (Windows Server 2012):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server\WindowsAuthenticationEnabled=1

Michael12345 suggested it here:

This is a really old question, but I may have found an answer.

I was getting the 401 Unauthorized error message, but still able to login using the account specified in the call to MSDeploy, as described in the question.

In my case, the problem was solved by giving the deploy account admin privileges on the machine being deployed too.

(I see that you were using an account called Administrator, so this might not be the case for you - but I had the same symptoms so wanted to post anyway).

I've just experienced a 401 and ERROR_USER_NOT_ADMIN. In my case, the problem was I was using a hostname set in my hosts file (also in the hosts file on the destination machine) for the computerName setting to the -dest: parameter. NTLM was trying to treat this host name as the domain part of the username (e.g. hostname\userName). Changing this to the IP address or or real machine name fixed the issue.

I did not have this type of error before but in Visual Studio 2015 Update 3 when create a new ASP.NET Core application the default publish profile does not work.

I did find a solution. For me adding the

<AuthType>NTLM</AuthType>

line in the .pubxml file fixed the issue.

Tags: iismsdeploymsdeployserviceagentntlm
ShareTweetPin

Related Posts

iis

How can I create a self-signed cert for localhost?

I've gone through the steps detailed in Is there a way to create a self-signed cert for "localhost" to avoid...

authentication

Sql Connection fails when using Integrated Security on IIS applications

In my web application on IIS 7.0, I want to make a connection to Sql Database Server for which my...

asp.net-mvc

ASP.NET MVC, Url Routing: Maximum Path (URL) Length

The Scenario I have an application where we took the good old query string URL structure: ?x=1&y=2&z=3&a=4&b=5&c=6 and changed it...

iis

Wamp server URL was not found

I have changed my apache port from 80 to 81 as on port 81 IIS was running. Now if I...

Next Post

Web deployment task failed. Could not connect...server did not respond

Hot tags

.net Algorithm amazon-web-services android Apache ASP.NET c# css django docker eclipse email google-app-engine google-cloud-platform hadoop Hive html ios iphone java javascript kubernetes linux macos maven mysql node.js oracle php postgresql python Python 3.X R ruby ruby-on-rails sockets spring spring boot SQL SQL SERVER TensorFlow unit-testing windows xcode 爬虫

    © 2022 Websitedic.com.

    No Result
    View All Result
    • index
    • Java
    • python
    • javascript