Sunday, June 29, 2008

Error “Server is not operational” using MOSS LDAP Membership Provider


If you are using MOSS and want to authenticate to AD through forms, MOSS offers you a custom membership provider to AD (and any other directory service that implements LDAP protocol). There is many articles and posts that talk about it here and here (broken link L).

Recently I have configured it with the following fragment in the web.config:

<membership
defaultProvider="SharePointLdapMembershipProvider">
<providers>
<add
name="SharePointLdapMembershipProvider" type="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bCe111e9429c" server="litwareinc"
port="389"
useSSL="false"
userDNAttribute="distinguishedName" userNameAttribute="sAMAccountName" userContainer="CN=Users,DC=litwareinc,DC=com" userObjectClass="person" userFilter="((ObjectCategory=group)(ObjectClass=person))"
scope="Subtree"
otherRequiredUserAttributes="sn,givenname,cn" />
</providers>
</membership>
<roleManager
defaultProvider="SharePointLdapRoleProvider" enabled="true"
cacheRolesInCookie="true" cookieName=".PeopleDCRole">
<providers>
<add
name="SharePointLdapRoleProvider" type="Microsoft.Office.Server.Security.LdapRoleProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bCe111e9429c" server="litwareinc"
port="389"
useSSL="false"
groupContainer="DC=litwareinc,DC=com" groupNameAttribute="cn" groupMemberAttribute="member" userNameAttribute="sAMAccountName" nAttribute="distinguishedName"
groupFilter="(ObjectClass=group)"
scope="Subtree" />
</providers>
</roleManager>

And get always this stack error:

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server General
Event ID: 7888
Date: 29/06/2008
Time: 3:45:39
User: N/A
Computer: MOSS
Description:
A runtime exception was detected. Details follow.
Message: The server is not operational.

Techinal Details:
System.Runtime.InteropServices.COMException (0x8007203A): The server is not operational.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindOne()
at Microsoft.Office.Server.Security.LDAP.FindOneObject(DirectoryEntry searchRoot, String filter, SearchScope scope, String[] propertiesToLoad, ResultPropertyCollection& entryProperties)
at Microsoft.Office.Server.Security.LdapMembershipProvider.GetUserAttributeBySearchProperty(String searchValue, String searchProperty, String returnAttribute)

I was able to make a LDAP query using LDAP://LITWARE as a connection string. But the provider was not able to connect to the server because it cannot resolve the IP of the LDAP server. If I replace the server="litwareinc" for server="127.0.0.1" (DC IP) or server="litwareinc.com" all works. Finally my web.config looks like this:

<membership
defaultProvider="SharePointLdapMembershipProvider">
<providers>
<add
name="SharePointLdapMembershipProvider" type="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bCe111e9429c" server="litwareinc.com"
port="389"
useSSL="false"
userDNAttribute="distinguishedName" userNameAttribute="sAMAccountName" userContainer="CN=Users,DC=litwareinc,DC=com" userObjectClass="person" userFilter="((ObjectCategory=group)(ObjectClass=person))"
scope="Subtree"
otherRequiredUserAttributes="sn,givenname,cn" />
</providers>
</membership>
<roleManager
defaultProvider="SharePointLdapRoleProvider" enabled="true"
cacheRolesInCookie="true" cookieName=".PeopleDCRole">
<providers>
<add
name="SharePointLdapRoleProvider" type="Microsoft.Office.Server.Security.LdapRoleProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bCe111e9429c" server="litwareinc.com"
port="389"
useSSL="false"
groupContainer="DC=litwareinc,DC=com" groupNameAttribute="cn" groupMemberAttribute="member" userNameAttribute="sAMAccountName" nAttribute="distinguishedName"
groupFilter="(ObjectClass=group)"
scope="Subtree" />
</providers>
</roleManager>


Then, you always need to ensure that the IP of your LDAP server can be resolved.

Note: For the user picker you need to add this line to the PeoplePickerWildcards section to allow the search function:


<PeoplePickerWildcards>
<clear />
<add key="AspNetSqlMembershipProvider" value="%" />
<add key="SharePointLdapMembershipProvider" value="*" />
</PeoplePickerWildcards>


Enjoy it!

Friday, June 6, 2008

SharePoint Day at Barcelona (Spanish)

En Raona estamos preparando el SharePoint Day donde haremos un repaso a la plataforma en general y profundizaremos en algunos aspectos como la búsqueda y la gestión de procesos.

Fechas: 17/06 Barcelona – 24/09 Madrid

Información y registro:

http://www.raona.com/Formacio/Seminaris/Seminarios2008/MicrosoftSharepointDay/tabid/304/Default.aspx

¿Nos vemos?

 
Online Visitors