Tuesday, June 3, 2008

Sharepoint People Picker and People Search

Hi All,

Here i would like to share something very interesting.

We have two options available in MOSS 2007 where we can find people. One is People Search and other is People Picker.

I would like to highlight the differene between these two. When you see the results you can see difference in them. the reason being difference is that they both use different data sources.

In the case of People Search it is fully reliable on Sharepoint profile database where as People Picker is fully reliable on Active Directory of your Domain. That is the reason it may return you more results.

The reason behind multiple results are following:

1) It also fetches people whoes account is disabled in AD
2) whose e-mail address is not mentioned
3) Service accounts are also countable in results

Let's have one understanding. People can have multiple account in multiple domains. But to keep in mind that there can be only one "Main" Account. Now when we say a Main account, it means that the account in which e-mail address is mentioned is called a "Main" account. and there can be only one "Main" account. All rest accounts do not have e-mail addresses.

So to filter out all those accounts that are not having e-mail address associated with it OR accounts that are disabled, here is a trick to accomplish this with the help of stsadm command.

After executing this command, in your people picker you will not get those accounts which are not having e-mail associated with it and also which are disabled.

Stsadm –o setproperty
–pn peoplepicker-searchadcustomfilter
–pv -<LDAP filter>
-url <WebApplication url>


For example :

Stsadm –o setproperty
–pn peoplepicker-searchadcustomfilter
-pv “(|(&(mail=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))(objectcategory=group))”
-url http://myportal

But you have to make sure that you will have this option available only if you run Security Patch kb934525.

More details about this security patch can be found : here

That's it. your job is done.

2 comments:

Anonymous said...

Hi, I would like the opposite. People picker does not show disable accounts and I would like people picker to show disable accounts.
Could you help me, how would the stsadmin command be?

SharePoint Kings said...

Anonymous,

no idea how to do that.
and don't think whether it is possible or not.




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com