views:

241

answers:

2

Greetings -

I have a SharePoint 2010 server running with the User Profile service setup to synchronize to Active Directory. I'd like to use the UserProfileManager.Search() method to return user profiles based on specific criteria. MSDN documentation for this method is here. It states that the method will return user profiles that match the specified search pattern. This is exactly what I want. However, there is no documentation on what a valid search pattern is. I've made a few guesses like "Department = 'HR'" but haven't had any luck. I can't find any other documentation or sample code. Can anyone provide samples of valid "search patterns?"

Another way to return user profiles is to do a query using the FullTextSqlQuery object. We don't yet have Search setup on this server so this isn't currently an option.

Thanks, Greg

A: 

Hi Greg,

I'm trying to activate the user profile service to synchronize with Active Directory. I've been trying for a couple of days with no success.

How did you activate it? Did you follow any guide?

Gabriel

Gabriel
Hi Gabriel - I had trouble getting it running too. This guide was helpful: http://www.harbar.net/articles/sp2010ups.aspx-Greg
Greg
This blog post is helpful too: http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx
Greg
+1  A: 

The UserProfileManager.Search method is limited to a few built-in fields. You cannot search on custom profile properties unfortunately. Here's an excellent post explaining it's use: link text

Michael Brockman
Thanks for the link Michael. I figured if I waited long enough someone at MS would eventually document it. :)
Greg