Tuesday, October 5, 2010

User Profile filtering options with SharePoint 2010

With SharePoint 2007 applying LDAP filters while importing user profiles from AD was not an easy task, but with SharePoint 2010 Microsoft again done a great job in making it easier for setting up filters for importing user profiles from AD.

Here is an example of importing User Profiles of Enabled user accounts from AD -

To import user profile information of user accounts that are enabled in Active Directory to SharePoint Server 2010, follow these steps: 



  1. On the Manage Profile Service page, click Configure Synchronization Connections.
  2. On the Synchronization Connections page, click the Active Directory connection that you want to edit, and then click Edit Connection Filters.
  3. On the Edit Connection Filters page, follow these steps:


    1. In Exclusion Filter for Users, change the Attribute drop-down to userAccountControl.
    2. In Exclusion Filter for Users, change the Operator drop-down to Bit on equals.
    3. In the Exclusion Filter for Users, select Filter box type to 2.
    4. Click Add.
  4. Click OK.

Note: Similar to userAccountControl attribute you can create a combinations of Exclusion Filter for Users and Exclusion Filter for Groups with a lot of other AD attributes.

A second option which also can be used to filter out user profiles based on OU(s)/user(s)/Group(s) directly from Synchronization Connections.   If you already have a synchronization connection then follow these steps for filtering users based on OU(s)/user(s)/Group(s).

  1. On the Manage Profile Service page, click Configure Synchronization Connections.
  2. On the Synchronization Connections page, click the Active Directory connection that you want to edit, and then click Edit.
  3. On the Edit synchronization connection page, follow these steps:


    1. Click on "Populate Containers" button, (make sure that you entered the password for AD sync account).
    2. Expand the tree view and uncheck any OU from which you don't want user profiles.
    3. You can also expand any OU and uncheck any user/group that you don't want to import.
    4. Click OK.
Issue to be aware of - I was able to select same criteria multiple times and it allowed me to save my synchronization connection without any problem. That was kind of odd.  See below

Attribute Operator      Filter              Action 
accountExpires                                   Is present    
accountExpires                                   Is present    
division                         Equals              A  
division                         Equals              A 

Except this one issue it really works well.


Friday, September 24, 2010

FAST Search - Adding Content Source for Scope Rule type

Note:- Before you follow any blog make sure to check that they are related to the version you are dealing with. Don't follow a blog if its for Beta version of SharePoint 2010 when you have released version.
If you want to create new SCOPES with FAST search, now you can create scope filter from GUI instead of creating them using Windows PowerShell.
From technet -
=========================================
Documented product changes implemented in the August 2010 Cumulative Update (CU) - http://technet.microsoft.com/office/ee748587.aspx. With the CU installed, the FAST Search Server 2010 for SharePoint scope filter is automatically generated based on the scope rules created by using the graphical user interface. Administrators no longer have to create the scope filter manually by using Windows PowerShell.
=========================================
Create and view search scopes (FAST Search Server 2010 for SharePoint)
http://technet.microsoft.com/en-us/library/ff453895.aspx
One thing that is not clear from the above link is, creating scope rules based on content sources with FAST search. It's very easy to do with SharePoint 2007/2010 search - For "Scope Rule Type" you can select "Content Source" and then select your content source from the drop down list.
Now with FAST search on "Scope Rule Type" you won't see "Content Source" as one of the option to select, but it's part of "Property Query" with "Property Query" we can give codition for selecting content source "ContentSource = FileShare"  (assuming that you already created a content source as FileShare).
Long story short with FAST search to access your Content source from a Metadata Property "ContentSource" which can be used to restrict or include results with Scope Rules.

Tuesday, July 6, 2010

SharePoint 2010 Training Resources

Here is a list of SharePoint 2010 resources that I thought might be useful to others -

Get Started Developing on SharePoint 2010

Software developers can use the SharePoint 2010 business collaboration platform to build enterprise-class solutions for intranet portals and the web. Use these ten modules to get started with development for SharePoint 2010 using Visual Studio 2010.


SharePoint 2010 Advanced IT Pro Training

Training to help experienced SharePoint IT Pros improve their skills and gain a deeper understanding of the product.


1|Core Architecture of SharePoint 2010
2|Security in SharePoint 2010
3|IT Pro Management in SharePoint 2010
4|Upgrading to SharePoint 2010
5|Enterprise Search in SharePoint 2010
6|Content Management in SharePoint 2010
7|Composite Solutions in SharePoint 2010
8|Communities in SharePoint 2010
9|Business Intelligence in SharePoint 2010
10|SharePoint Online Overview

SharePoint 2010 Advanced Developer Training

For developers, SharePoint 2010 provides a business collaboration platform to rapidly build solutions and respond to business needs. SharePoint 2010 Advanced Developer Training offers technical training as self-paced modules and hosted labs for SharePoint 2007 professionals who want to upgrade their skills to SharePoint 2010.

1|Developer Roadmap and Tools
2|Core Development
3|User Interfaces and Lists
4|Data Access in Technologies
5|Composite Solutions
6|Enterprise Content Management
7|Enterprise Search
8|Business Intelligence
9|Communities
10|Development Life Cycle

Wednesday, June 16, 2010

Convert UTC date using Convert.ToDateTime Surprise

While working on a project I had to convert a date string to DateTime object. As the date value was coming from SharePoint it was a UTC date - "2010-01-01T00:00:00Z". So looking at the date value I expected that Convert.ToDateTime or DateTime.Parse will return me 1/1/2011 12:00:00 but to my surprise I was getting 12/31/2010 7:00:00 PM I quickly realized the mistake I was doing and searched MSDN and thanks to SPUtility class for the rescue. So convert UTC date string to a DateTime object use the following method to get the correct date -

objectDateString is object type with value "2010-01-01T00:00:00Z"

SPUtility.CreateSystemDateTimeFromXmlDataDateTimeFormat(objectDateString.ToString()) returns {1/1/2011 12:00:00 AM} System.DateTime

or the following will also return correct date -

Convert(objectDateString.ToString()).ToDateTime().ToUniversalTime()



using DateTime.Parse or Convert.ToDateTime I was getting wrong dates -
DateTime.Parse(objectDateString.ToString()) returns {12/31/2010 7:00:00 PM} System.DateTime

Convert.ToDateTime("2010-01-01T00:00:00Z") return  {12/31/2010 7:00:00 PM}

Again lesson learned to treat DateTime values with respect. :)

For more information in this -
http://www.jamestsai.net/Blog/post/SPRegionalSettingsGlobalTimeZones-How-to-build-world-clock-get-time-zones-information-in-SharePoint.aspx

http://www.novolocus.com/2008/07/31/sharepoint-web-services-and-utc-time-fun-and-games/

Saturday, May 22, 2010

Using this.Submit to close InfoPath form

Lately I was working on a InfoPath form.  I thought that it will be nice if I can validate the form with custom code and also close it.  I didn't liked the Submit button event handler as it was displaying its own pop dialog box before showing my custom error messages.  I added my own button I tried to use this.Submit() method to execute Submit form option for closing the form, as we know that you cannot call "Close form" from your code.  On form Submit option using "Perform custom action using code" I end up gettting this exception

XmlForm.Submit cannot be called from the SubmitEventHandler.

Finally I figured out that if I use "Perform custom action using rule" on Form Submit options dialog box then from custom button action event handler I can call this.Submit() and it allow for me allowing me to close the form by calling form Submit option - "Close the form".

In case anyone of you interested in how its done here is my project and xsn file -

http://cid-cb9fe32f865358ac.skydrive.live.com/browse.aspx/Public/Submit?lc=1033

also here are some of settings that I had in my form -

On the rule dialog box I just set a temp field to 1,



I hope this will be usefull to those who want to submit and close the form on the same page using code without adding extra view/page to close the form.


Thanks,
Suhaib Khan