Home > Uncategorized > 401 Not Authorized For MSDEPLOY‏ (msdeployAgentService)

401 Not Authorized For MSDEPLOY‏ (msdeployAgentService)

When you get this error from msdeploy:

“Error: The remote server returned an error: (401) Unauthorized.”

you need to give the remote user elevated rights to get authorization.


To disable UAC remote restrictions, follow these steps:

  1. Click Start, click Run, type regedit, and then press ENTER.
  2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  3. If the LocalAccountTokenFilterPolicy registry entry does not exist, follow these steps:
    1. On the Edit menu, point to New, and then click DWORD Value.
    2. Type LocalAccountTokenFilterPolicy, and then press ENTER.
  4. Right-click LocalAccountTokenFilterPolicy, and then click Modify.
  5. In the Value data box, type 1, and then click OK.
  6. Exit Registry Editor.
Categories: Uncategorized
  1. David
    December 4, 2010 at 5:00 pm



  2. May 4, 2011 at 5:55 pm

    muchas gracias


  3. Andrew
    October 12, 2011 at 3:18 am

    You are a god amongst men. I was trying to web deploy to Windows 7 with RemoteAgent and getting “An unsupported response was received. The response header ‘MSDeploy.Response’ was ‘V1’ but ‘v1’ was expected. The remote server returned an error: (401) Unauthorized.” and this fixed it. Thank you so so so much.


  4. Matthias
    January 2, 2012 at 12:23 pm

    thank you so much!
    Why didn’t I find this post 4 hours ago.


    • September 28, 2012 at 3:13 pm

      yes…i have same feeling..

      thx for posting this solve
      help me a lot!!


  5. Michael
    May 24, 2012 at 10:25 am

    you made my day !!!!
    Why is there no hint doing that in the documentations from Microsoft?


  6. November 23, 2012 at 6:49 pm

    This worked for me. I tried various combinations of msdeploy.adx, msdeployagentservice, http, https, windows auth, windows + iis auth, etc.

    My settings from VS2012 to a Windows 7 Server

    Publish Method: Web Deploy
    Service URL: http://IPOnLocalVPN/msdeployagentservice
    Site / Application: Default Web Service/myApp
    User Name: MachineName\Admin
    Password: blah

    Pretty agonizing that all of the MS documentation fails to mention this little key. I guess my naive question is this a fail in the documentation, or a workaround because I didn’t do something else? (Keeping in mind that I worked on this connection problem for about 7 hours as an IIS noob, and read ~20 different articles from different sources on Web Deploy and then error remediation).



  7. September 3, 2013 at 6:33 am

    GREAT!! thanks!


  8. October 3, 2013 at 4:30 pm

    Huge THANKS, Why didn’t I find this article 5 hours ago.


  9. Rich O
    October 23, 2013 at 2:17 pm

    I concur wholeheartedly with above acolades. I was blaming Netscaler for this. Much obliged


  10. TrickyMicky2
    November 5, 2013 at 11:09 am

    After reading various types of suggestions on this error on web, I stumbled on this page. After implementing the steps outline I was back to life.
    My problems arose when the certificate on web server/domain was changed


  11. sleeper
    January 29, 2014 at 7:50 pm

    This solved my problem on Server 2012R2 with Web Deploy 3.5 Thanks.


  12. February 12, 2014 at 3:24 pm

    HOLY FUCK, ty man!


  13. GFI
    September 18, 2015 at 6:27 pm

    Si su empresa no está externalizando recursos ahora mismo,
    seguramente lo haga en el futuro.


  14. kolibrizas
    May 4, 2017 at 9:55 pm

    OMG Love you!!!


  15. Venkat
    May 25, 2017 at 4:14 am

    I am getting below error. could you please help me here

    “C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe” -verb:dump -source:package=”JenkinTestApp\obj\Debug\_PublishedWebsites\JenkinTestApp_Package\JenkinTestApp.zip”,computerName=, -allowUntrusted=true

    Info: Using ID ‘ede61ea1-55c4-40ca-b71f-075a4477fa2e’ for connections to the remote server.

    More Information: Connected to ‘’ using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on ‘’. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
    Error: The remote server returned an error: (401) Unauthorized.


  16. vany
    August 29, 2017 at 12:47 pm

    Didn’t work for me… 😦


  17. PH
    January 11, 2018 at 10:48 am

    perfect !
    this key doesn’t exist on 2012 but is already equals to 1 on 2008 !


  1. October 7, 2013 at 7:29 am
  2. October 7, 2014 at 2:00 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: