Thursday, July 10, 2008

UpdateListItems fails with “%20” urls

The web service Lists.asmx has the web method UpdateListItems that allows you to add, edit or delete an item in a list or document library. In the batch xml you need to put the FileRef parameter as the url of the item or folder when you are working with a document library. If your url has blanks the browser will replace it with "%20" and it is not valid for the UpdateListItems. So, you need to put the url with blanks qnd all works.

Thursday, July 3, 2008

SPUtility.SendEmail

I want to make one comment about this method. It cannot be used out of a SharePoint context because inside it uses SPControl.GetContextWeb(HttpContext.CurrentIL. I wanted to use it to send an email from a timer job.

Have you any idea to send an email using the web applications settings for the outgoing mail from a timer job?

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?

Tuesday, April 29, 2008

Searching pending approval documents

If you have enabled the content approval in your document libraries and only the approvers of the items can access to the unpublished versions, you will have a problem with the search. When a user launches a search query, he will see listed in the search results the pending approval documents although he does not have permissions to access to an unpublished version of it. It will be able to read all the indexed data, but when he tries to access to the item it gets an unauthorized error.

This behavior is correct, because the security trimmer omits the permissions on the draft versions. The solution is to create your own security trimmer and register it for the corresponding crawl rule. If you follow the example in the msdn documentation you only need to add this line to determine if the current user has access to the item listed in the search for each crawlURL:

bool hasPermission = item.DoesUserHavePermissions(web.AllUsers[strUser], SPBasePermissions.ViewListItems);

From the crawl url you can get the GUIDs and ID item required to get an SPListItem (item in the code above).

Enjoy it!

Saturday, April 26, 2008

The Sharepoint definition

What is SharePoint? That is the first question that a customer, friend, wife … make when you talk them about SharePoint. My response always was different and here you can see some of the answers that I gave joined in a simple response:

"SharePoint is a Microsoft's product to develop portals …. And it can be used also to search information in many places (Notes, SAP, …) … and gives you a complete collaboration environment… And includes some advanced functionality like workflows, web forms, excels on web… "

This definition is not simple, and the most important, it does not define SharePoint entirely. The reason: SharePoint is too large and cannot be defined it completely on a single sentence.

For that reason, now I have a new definition for SharePoint:

"SharePoint is a Microsoft's product which connects the information with the people in each level of the business"

This sentence is too simple. But from this definition you can explain the functionalities around the fact that SharePoint approaches the information to the people.

Please, feel free to post your own definition or any comment.

Wednesday, April 23, 2008

SharePoint Designer and Office Live

I am trying to connect to my Microsoft Office Live Small Business Site from SharePoint Designer and it does not work. If I open my office live site using http:// it prompts the credentials form and then shows me the error "Server Error: The Version of Windows SharePoint Services running on the server is more recent than the version of SharePoint Designer you are using. You need a more recent version of SharePoint Designer". If I put the url of my site using https:// it does not ask for my credentials but shows me the same error again.

I have tried the solution that this post offered, but it does not work: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1918526&SiteID=1

It can be possible, because in this video we can see SPD in action with Office Live: http://channel9.msdn.com/Showpost.aspx?postid=262657

Did you try? Works for you?

I have SPD with SP1 and my Office Live Site is not beta: http://alexpelaez.web.officelive.com/default.aspx.

Thanks in advance!

 
Online Visitors