locked
COMException (0x8007203a): The server is not operational. RRS feed

  • Question

  • User-2049280417 posted

    Hello, 

    Today I'm trying to new a user with ActiveDirectoryMembershipProvider in the CreateUserWizard control, it throws me the exception:  System.Runtime.InteropServices.COMException: The server is not operational.

    However, I can get users via the Membership.FindUsersByName(usernameToMatch, pageIndex, pageSize, out totalRecords) method, so it proves my LDAP connection string is right.  I can not just write info into my AD.

    And I'm sure the application of creating new users can work well last week, but it fails today ....

    So mysterious....  Can someone provide me some internal details about this senseless message?

    Thanks a lot.

     

        <connectionStrings>
            <add name="ADMembershipService" connectionString="LDAP://devdc01/OU=abcPortal,DC=abcdev,DC=com"/>
        </connectionStrings>
        <system.web>
            <membership defaultProvider="ADMembershipProvider">
                <providers>
                    <add name="ADMembershipProvider" 
                    type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
                    connectionStringName="ADMembershipService" 
                    connectionProtection="Secure" applicationName="/abcPortal" 
                    connectionUsername="abcdev\admin" connectionPassword="abc+1234" 
                    enableSearchMethods="true" minRequiredPasswordLength="3" minRequiredNonalphanumericCharacters="0"/>
                </providers>
            </membership>
     

    [COMException (0x8007203a): The server is not operational.
    ]
       System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +377678
       System.DirectoryServices.DirectoryEntry.Bind() +36
       System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
       System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) +78
       System.DirectoryServices.DirectorySearcher.FindOne() +47
       System.Web.Security.ActiveDirectoryMembershipProvider.IsUpnUnique(String username) +283
       System.Web.Security.ActiveDirectoryMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +2432
       System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +318
       System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +102
       System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418
       System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +161
       System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
       System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

    Thursday, March 26, 2009 9:41 PM

All replies

  • User-2049280417 posted

    Figure it out!!!  It's the problem about the username mapping mode of userPrincipalName or sAMAccountName.

    If you want to create a new user with the ActiveDirectoryMembershipProvider, explicitly specify the sAMAccountName mode(username only) in the provider setting. It take userPrincipalName mode(username@domain)

            <membership defaultProvider="ADMembershipProvider">
                <PROVIDERS>
                    <ADD class=st name=""ADMembershipProvider" 
                    type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
                    connectionStringName="ADMembershipService" 
                    connectionProtection="Secure" applicationName="/IBAPortal" 
                    connectionUsername="ibadev\xfwang" connectionPassword="iba+1234" 
                    enableSearchMethods="true" minRequiredPasswordLength="3" minRequiredNonalphanumericCharacters="0"
                    attributeMapUsername="sAMAccountName" 
                   >

    Even though it works again, but it does not seem reasonable, I think.  ASP.NET team are supposed to do some more work.
    Why is it not supported in the userPrincipalName mode? You should tell the folk. Worse, you take the userPrincipalName mode by default .....
    If it's not available indeed, you also should make the error message more meaningful . 'The server is not operational' is alway fooling me.

    Thanks anyway.

    Thursday, March 26, 2009 11:08 PM