locked
401.2 error accessing CRM 4 from inside WS2008R2 domain RRS feed

  • Question

  • I should start off by saying this is my first CRM deployment.  For that matter, it's my first AD deployment.  So I have a lot to learn.  That said, everything seems to work well - as long as I don't try to access CRM from a browser or Mail Router on a different PC in the domain than the PC it's installed on.

    I have a 3 server farm - all VMs. 

    InstanceB = AD + Mail Router
    InstanceC = SQL Server
    InstanceD = CRM v4 + Rollup 8

    All OS = Windows Server 2008 R2.  So IIS version = 7.5.7600.16385.  Ping works fine between all endpoints.

    I initially saw the problem connecting from InstanceB when trying to configure a mail queue in Mail Router.  It complained bitterly each and every time I tried with various creds.  I verified the creds of my one and only user.  Then I tried with a browser - just to see if I could get to the main page of CRM. No luck.  I get 401.2 error.  (I found the .2 part by checking the log.)  If I point my browser to the default web site, it works great.

    Any help out there?  There's precious little out there right now that specifically mentions IIS 7.5 - but of course I don't know that to be the issue. 

    Oh - and I also checked that Windows Authentication is turned ON and Anonymous Authentication is turned OFF using the configuration manager tool in IIS - for the CRM Site.

    Thanks!
    Greg
    Tuesday, February 16, 2010 5:23 AM

Answers

  • Greg,

    I have recently seen the thread so I may ask something that may be redundant for you; however, I hope this will help us get your CRM working on remote servers with the correct configuration.



    1. What are the SPN's set on your Domain account that is running the CRMAppPool?
        Look at the Service Account section for the SPN information.
        http://support.microsoft.com/kb/946677

        Also http://blogs.msdn.com/crm/archive/2009/08/06/configuring-service-principal-names.aspx will help a lot understanding SPN's for CRM.
       
        Note: On a Domain account you should have HTTP and not HOST SPN's. Computer account Automatically get configured with HOST as it is
                 Network Service. Network Service = ComputerName$
       
    2. What is the port used by CRM website?

    3. Have you used a Host Header in IIS bindings?

    4. Is the website working as both  http://localhost:PORT and http://servername:PORT on the CRM box?

    5. For the http 401.2 error follow http://support.microsoft.com/kb/215383
        Note: run the following command at "C:\Inetpub\Adminscripts" to find the websites Auth Providers. ("Website" is the website identifier
        which can be found by clicking the websites container in IIS)
        cscript adsutil.vbs get w3svc/<var>WebSite</var>/root/NTAuthenticationProviders

        
    If the above query returns nothing then run the following command. (don't forget Website = Website identifier)
        cscript adsutil.vbs set w3svc/<var>WebSite</var>/root/NTAuthenticationProviders "Negotiate,NTLM"

    6. When you try to access http://CrmServer:PORT from a remote site do you get an error? (assuming you can access CRM locally and not on 
        remote servers, like you mentioned at the begining of the post.)

    Now there are a few things. In II7 we have Kernel mode overrides your AppPool account settings which may cause Kerberos issues. Also check if Firewall on CRM server has the CRM website's port in the Exceptions list to allow connections.

    I think this should help you. :-)
    Let me know if you need more information.


    Kaustubh Giri
    • Marked as answer by GregoryOliver Saturday, February 27, 2010 8:58 PM
    Friday, February 26, 2010 11:11 PM

  •     cscript adsutil.vbs get w3svc/<var>WebSite</var>/root/NTAuthenticationProviders

        cscript adsutil.vbs set w3svc/<var>WebSite</var>/root/NTAuthenticationProviders "Negotiate,NTLM"

    Please change <var>Website</var> accorting to the Site Identifier.

    Example the commands will look loike this:
    cscript adsutil.vbs get w3svc/2/root/NTAuthenticationProviders

    cscript adsutil.vbs set w3svc/2/root/NTAuthenticationProviders "Negotiate,NTLM"

    2
    is my website identifier.

    Kaustubh Giri
    Friday, February 26, 2010 11:14 PM

All replies

  • Hi,

    is the user outsight the farm in the same user, you use for install? If not, has you create the user in crm and give him a security role?

    Viele Grüße

    Michael Sulz
    MVP für Microsoft Dynamics CRM
    Tuesday, February 16, 2010 7:43 AM
  • The installation user is the same as the user in CRM, and I signed in with that same userid on the other machine when attempting to log in.

    Thanks,
    Greg
    Tuesday, February 16, 2010 4:00 PM
  • In IE make sure you have the crm server address added to trusted sites and that in custom level the authentication is set to Log in with current username and password.

    Did you set the CRM install to run under the Network Service account. Which means your application pool for the CRM website will be NS and the Async service should also be Network Service?

    401.2 does seem to suggest the website not having authentication setup correctly but you can access it when you logon to the server and then open it in IE am I right?
    Tuesday, February 16, 2010 10:27 PM
    Moderator
  • Hi Gregory,

    Please look at the following: http://support.microsoft.com/kb/253667 and http://social.microsoft.com/forums/en-US/crmdeployment/thread/b8b42c58-ac10-4676-9922-bbf5de426fb8/
    Henrik Jensen Instructor / Consultant MCP, MCAD, MCSD, MCTS, MCPD, MCITP, MBSS, MBSP, MCT www.crmblog.dk (Danish only)
    • Proposed as answer by Carla J Sunday, April 18, 2010 11:11 PM
    Wednesday, February 17, 2010 7:40 AM
  • I would suspect dns issues or network security rights within the domain based on the information you are providing "as long as I don't try to access CRM from a browser or Mail Router on a different PC in the domain than the PC it's installed on". 

    The issue you are reporting is a little challenging to understand. 


    Best Regards | Twitter: edwardsdna
    • Proposed as answer by Donna EdwardsMVP Sunday, February 21, 2010 9:33 PM
    • Marked as answer by Jim Glass Jr Tuesday, February 23, 2010 6:09 PM
    • Unmarked as answer by GregoryOliver Friday, February 26, 2010 4:53 AM
    Sunday, February 21, 2010 9:33 PM
  • Thanks very much, Henrik.  This gave me a clue, but I don't think I'm quite there yet.

    It turns out that if I turn off Integrated Windows Authentication in IE it works ok - from a Windows 7 client.  I still can't get it to work with a WS2008R2 client.

    I also did the setspn command - because the CRMAppPool is running under a domain account - I had defined it previously as http rather than HOST.  I thought I followed the instructions in the installation guide pretty closely...

    So - I would very much like to understand this better if anyone has any hints.  Hopefully this will also allow me to configure the Mail Router correctly - as this was the original need that sent me down this path.

    Not quite Answered.  :)  I just needed to take a breather for a few days.

    Greg
    Friday, February 26, 2010 4:53 AM
  • Greg,

    I have recently seen the thread so I may ask something that may be redundant for you; however, I hope this will help us get your CRM working on remote servers with the correct configuration.



    1. What are the SPN's set on your Domain account that is running the CRMAppPool?
        Look at the Service Account section for the SPN information.
        http://support.microsoft.com/kb/946677

        Also http://blogs.msdn.com/crm/archive/2009/08/06/configuring-service-principal-names.aspx will help a lot understanding SPN's for CRM.
       
        Note: On a Domain account you should have HTTP and not HOST SPN's. Computer account Automatically get configured with HOST as it is
                 Network Service. Network Service = ComputerName$
       
    2. What is the port used by CRM website?

    3. Have you used a Host Header in IIS bindings?

    4. Is the website working as both  http://localhost:PORT and http://servername:PORT on the CRM box?

    5. For the http 401.2 error follow http://support.microsoft.com/kb/215383
        Note: run the following command at "C:\Inetpub\Adminscripts" to find the websites Auth Providers. ("Website" is the website identifier
        which can be found by clicking the websites container in IIS)
        cscript adsutil.vbs get w3svc/<var>WebSite</var>/root/NTAuthenticationProviders

        
    If the above query returns nothing then run the following command. (don't forget Website = Website identifier)
        cscript adsutil.vbs set w3svc/<var>WebSite</var>/root/NTAuthenticationProviders "Negotiate,NTLM"

    6. When you try to access http://CrmServer:PORT from a remote site do you get an error? (assuming you can access CRM locally and not on 
        remote servers, like you mentioned at the begining of the post.)

    Now there are a few things. In II7 we have Kernel mode overrides your AppPool account settings which may cause Kerberos issues. Also check if Firewall on CRM server has the CRM website's port in the Exceptions list to allow connections.

    I think this should help you. :-)
    Let me know if you need more information.


    Kaustubh Giri
    • Marked as answer by GregoryOliver Saturday, February 27, 2010 8:58 PM
    Friday, February 26, 2010 11:11 PM

  •     cscript adsutil.vbs get w3svc/<var>WebSite</var>/root/NTAuthenticationProviders

        cscript adsutil.vbs set w3svc/<var>WebSite</var>/root/NTAuthenticationProviders "Negotiate,NTLM"

    Please change <var>Website</var> accorting to the Site Identifier.

    Example the commands will look loike this:
    cscript adsutil.vbs get w3svc/2/root/NTAuthenticationProviders

    cscript adsutil.vbs set w3svc/2/root/NTAuthenticationProviders "Negotiate,NTLM"

    2
    is my website identifier.

    Kaustubh Giri
    Friday, February 26, 2010 11:14 PM
  • Kaustubh,

    This did the trick.  It turns out that the SPN that I created did not have the port number on it.  Adding the port number fixed things up.  I deleted the HOST spn and modified the HTTP spn that was still there.

    Thank you very much for joining the thread!

    Cheers!
    Greg
    Saturday, February 27, 2010 8:58 PM
  • Greg,

    My pleasure. :-)
    I am glad the issue is resolved.

    Have a good one!
    Kaustubh Giri
    Monday, March 1, 2010 10:12 PM