<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>SharePoint Magazine &#187; Active Directory</title>
	<atom:link href="http://sharepointmagazine.net/tag/active-directory/feed" rel="self" type="application/rss+xml" />
	<link>http://sharepointmagazine.net</link>
	<description>SharePoint Magazine is an online Magazine dedicated to the world of SharePoint</description>
	<lastBuildDate>Mon, 05 Jul 2010 09:14:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Everything You Need to Know about BDC: Part 6 of 8</title>
		<link>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-6-of-8</link>
		<comments>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-6-of-8#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:44:53 +0000</pubDate>
		<dc:creator>Randy Williams</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[BDC]]></category>
		<category><![CDATA[Business Data Catalog]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[User Profiles]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=2466</guid>
		<description><![CDATA[In this article, the focus will be on configuring User Profiles to import properties from external systems via the BDC.]]></description>
			<content:encoded><![CDATA[<p>Greetings and welcome to Part 6 of our Business Data Catalog (BDC) Series.  In this article, the focus will be on configuring User Profiles to import properties from external systems via the BDC.  I’ll start off by giving you a good grounding in the overview section.  I’ll then jump into creating the two different types of import connections, 1:1 and 1:many, and then show you in detail how to map your profile properties.   Finally, I’ll wrap up with some troubleshooting tips.  By the end, you’ll have a solid understanding of how to configure your ADFs and User Profiles to import and map your properties.</p>
<p>In case you’re just joining us in the series, here are our previous five articles:</p>
<p><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-1-of-8" target="_blank">Part 1</a>.  BDC Purpose and technical architecture</p>
<p><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-2-of-8" target="_blank">Part 2</a>.  Detailed overview of the Application Definition File (ADF) and how to develop one to connect to a back-end database</p>
<p><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-3-of-8" target="_blank">Part 3</a>.  Developing an ADF to connect to Web Services</p>
<p><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-4-of-8" target="_blank">Part 4</a>.  Consuming Business Data through Web Parts and SharePoint lists</p>
<p><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-5-of-8" target="_blank">Part 5</a>.  Implementing Enterprise Search with Business Data</p>
<h4>Overview</h4>
<p>User Profiles within MOSS are a great way to store key information about SharePoint users.  This information, stored within individual profile properties, contains useful content such as first name, last name, date of hire, the user’s manager, and numerous personal details such as interests and skills.  This user metadata can be used when executing workflow, searching for people, utilizing social networking aspects such as my sites, defining audiences, any many other SharePoint capabilities.  SharePoint contains dozens of built-in properties, and you can add any custom properties as needed.</p>
<p>While all of this a great benefit to enhancing SharePoint’s knowledge of these people, there may be a drawback to this.  Here is yet another database of information that needs to be populated!  In most organizations some of this information lives within Active Directory (AD) and perhaps other details can be found in repositories such as HR systems, so you can say that SharePoint is really just duplicating what already exists elsewhere.  The primary goal of this article is to show you how you can eliminate this redundant data entry by pulling this authoritative information from your external systems through the BDC.</p>
<p>User Profiles and the profile properties are all maintained within your Shared Services Provider (SSP).  User profiles can be created manually, or you can create import connections which allows you to automatically synchronize these values from external systems.  Supported external systems are AD, LDAP (such as Lotus Notes), and BDC.</p>
<p>An important detail you must understand is that only AD or LDAP can be set up as a primary (or master) connection.  A BDC connection cannot be.  A primary connection means that a SharePoint profile with an account name (e.g. domain\username) can be created from this source.  BDC can only be a secondary connection, meaning that it is only able to fill in additional properties for an existing profile—in other words, it cannot create a profile.</p>
<p>To better explain, see Figure 1 below which shows the profile being created (based on the Account name) from AD and additional properties coming from an HR System (click image to enlarge):</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image24.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb24.png" border="0" alt="image" width="404" height="294" /></a></p>
<p><strong>Figure 1: Mapping profile properties between SharePoint and external systems</strong></p>
<p>The arrows reflect the mapping between SharePoint profile properties and columns in external systems.  You can see that some information (such as first and last name) may be duplicated in external systems.  When defining mapping for a profile property, you can only specify a single source for the data.  Based on the arrows, the decision was made to pull the first and last name from AD.</p>
<p>For many organizations, this is a common scenario.  AD, maintained by the IT group, typically contains only a minimal amount of accurate user meta data.  Other systems, often maintained by the HR group, contains additional values.  SharePoint allows you to set up multiple primary and secondary connections to ensure all your profiles can be created and populated as needed.</p>
<p>Now that you have a basic understanding, the rest of the article will focus on how to create and configure these secondary BDC import connections.</p>
<h4>Creating BDC Import Connections</h4>
<p>Prior to creating a BDC Import Connection, I recommend you configure and ensure that your AD or LDAP primary connection is functioning.  Once this is working, you can then focus on your secondary BDC connection.  For my upcoming demos that I’ll walk you through, I am pulling accounts from a single domain inside AD.</p>
<p>To create a BDC Import connection, first access your User Profile and Properties screen within your SSP (Central Administration –&gt; SSP –&gt; User profiles and properties).  On this screen, click on the View Import Connections link.  Then click on the Create New Connection toolbar button.  Finally, choose Business Data Catalog type in the drop down list.  This will yield the following screen:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image7.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb7.png" border="0" alt="image" width="504" height="356" /></a><br />
<strong>Figure 2: Creating a BDC Import Connection </strong></p>
<p>In Figure 2 above, you’ll notice that you have two mapping options (depicted by the radio buttons),  1:1 and 1:many.  Let’s look at each option in detail:</p>
<h4>1:1 Import Connection Type</h4>
<p>A 1:1 connection is the most common type of connection that is used.  This means that a single profile in SharePoint will map to a single entity record that is returned from BDC.  For example, if we have a user profile for synergy\afuller as shown in Figure 1 above, this user will also exist in an external system.  For a 1:1 mapping, a Specific Finder method will be called based on the selected entity.  This shouldn’t surprise you as a Specific Finder method returns a single record from the external system.  A good question you might be thinking is how does it know which record to pull?  I’ll answer this question as I show you how to configure the connection.</p>
<p>To configure the 1:1 mapping as shown in Figure 2, we need to first start off by creating or identifying an existing profile property that can be used to uniquely identify the user in the external system.  This property must also match the identifier that is defined for your entity in your ADF.  In my example, I will be using EmployeeID which is the primary key for an Employees table in a SQL Server database.  Employees represents a table usually found in HR or ERP systems.  Here is the Identifier as reflected in the ADF:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image8.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb8.png" border="0" alt="image" width="404" height="61" /></a><br />
<strong>Figure 3: EmployeeID as the Identifier for Employees Entity</strong></p>
<p>And here is the Specific Finder:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image9.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb9.png" border="0" alt="image" width="534" height="103" /></a><br />
<strong>Figure 4: Specific Finder for Employees Entity</strong></p>
<p>As you can see, I have selected EmployeeID to be the unique identifier.  Since I don’t have a built-in profile property in SharePoint that stores EmployeeID, I’ll create one.  This is necessary for the 1:1 mapping to work.  Here is how it looks after I’ve created it:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image10.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb10.png" border="0" alt="image" width="346" height="60" /></a><br />
<strong>Figure 5: Newly Created EmployeeID Profile Property</strong></p>
<p>I chose the integer type because the property’s type must be compatible with the type defined in the Identifier (which was defined as System.Int32 as shown in Figure 3).</p>
<p>Now that this is done, I can create my BDC Import connection.  (Note: Even though you are only creating a 1:1 mapping that will use a Specific Finder, this screen also expects a Finder method.  Even though the Finder method is only used when creating 1:Many connections as discussed below, you must still have one or you will get an error when you select the entity from the catalog in this screen.)</p>
<p>Going back from Figure 2 above, after selecting Business Data Catalog as the type, you must enter a connection name.  I recommend a friendly name that you’ll easily recognize. For my demo, since I’m pulling employee information from an HR system, I’ll call the connection HREmployee.  Here is how it looks just prior to saving:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image11.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb11.png" border="0" alt="image" width="334" height="306" /></a><br />
<strong>Figure 6: Creating a 1:1 Import Connection</strong></p>
<p>You’ll notice that I selected the EmployeeID profile property that was just created.  For this to work, I now need to go into my current SharePoint profiles and manually enter in a values for EmployeeID.  This is necessary in my example since SharePoint must know what value to pass to the Specific Finder.  If you’re using a built-in profile property that is already populated (such as the Account name), you don’t need to do this.</p>
<p>Now that the 1:1 relationship between the User Profile and the external system is set up, it’s time to figure out which profile properties you want to import.  If you refer back to Figure 1 above, you’ll see that I illustrate the importing of Title and About me properties from the external system.</p>
<p>For the demo here, I’ll map two existing properties, Hire Date and About me.  You do this by editing the profile property (SSP –&gt; User profile and properties –&gt; View profile properties –&gt; Choose a property and edit).  There’s no reason why I can’t create new properties and map these; the process is the same.  Here is how to map the Hire date profile property to the HireDate column from the HREmployees import connection:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/clip-image001.gif"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/clip-image001-thumb.gif" border="0" alt="clip_image001" width="525" height="345" /></a><strong><br />
Figure 7: Mapping Hire Date</strong></p>
<p>Figure 7 above shows the upper and lower portion of the same screen.  When choosing a column in the Data source field to map drop down list, you’ll be presented with a list of all the columns returned from the Specific Finder.  So, the rule of thumb is the ensure that you are returning all columns you want to map from your Specific Finder.  As with creating the import connection, when mapping properties this way, you must ensure the data types are compatible.  If they are not, you’ll be given an error message like this: <em>Cannot map to this data source field. This property is of type &#8216;date&#8217; and the data source field you are mapping to is of type &#8216;System.String&#8217;</em>.</p>
<p>I have also mapped the About me property to the Notes column defined in the Specific Finder.  At this point, the mapping configuration is in place.  We’re not quite done yet, however.</p>
<p>Another important step is to ensure that your Default Content Access Account has permissions to update these profile properties through the BDC.  The Default Content Access Account is configured when setting up Enterprise Search (SSP –&gt; Search settings –&gt; Default content access account).  If you prefer, you can also set a specific account when configuring the User Profile Import.  Just go to SSP –&gt; User profile and properties –&gt; Default access account.  Now that you know what your access account is, you must grant this account two sets of permissions:  1) Permissions to update your profile properties and 2) permissions to call into these BDC methods.</p>
<p>To grant permissions to update profile properties, go to SSP –&gt; Personalization services permissions.  On this screen, grant your access account the Manage User Profiles permission as shown here:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image13.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb13.png" border="0" alt="image" width="384" height="236" /></a><br />
<strong>Figure 8: Granting Content Access Account Manage User Profiles Permissions</strong></p>
<p>If you’ve worked much with profile properties, you’ve probably noticed that each property can be individually secured by adjusting its privacy setting.  The Manage User Profiles permission grants my access account (SYNERGY\MOSS.Search) write permissions to all profile properties.  Without this, you’ll need to set the privacy level of each mapped property to Everyone, which may not be the best security level.</p>
<p>The second permission is to grant this access account permissions to the BDC entity.  If you’ve been following our series, we covered BDC permissions in <a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-2-of-8" target="_blank">Part 2</a>.  The minimum permission you need to grant is Execute as shown below.  You access this screen from SSP –&gt; View Applications –&gt; &lt;Select ADF&gt; –&gt; &lt;Select entity&gt; –&gt; Manage Permissions.  In this screen shot, I grant MOSS.Search execute permissions to the Employees entity:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image14.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb14.png" border="0" alt="image" width="464" height="165" /></a><br />
<strong>Figure 9: Granting Access Account Entity Permissions in BDC</strong></p>
<p>Finally, we are now done and ready to import.  Let’s quickly recap to make sure we have these steps down.  Again, we’re talking about a 1:1 mapping.</p>
<p>1.  Ensure ADF is prepared with a Specific Finder returning the columns you want to map.</p>
<p>2.  Create a new or choose an existing profile property that contains values to match the entity identifier.  In my example above, I used EmployeeID.</p>
<p>3.  Create a 1:1 import connection.</p>
<p>4.  Map your desired profile properties to columns returned from Specific Finder.</p>
<p>5.  Grant your content access account permissions</p>
<p>To start the import, return to the main User Profiles screen and click Start full import.  This will first do a full import from your primary import connection.  The status here is reflected next to Profile import status shown below.  Once that is done (and sometimes with a brief minute or two delay after it finishes), the secondary imports from BDC will begin.  This is reflected next to Membership &amp; BDC import status.  Both are shown highlighted here:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image15.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb15.png" border="0" alt="image" width="524" height="262" /></a><br />
<strong>Figure 10: User Profile import status</strong></p>
<p>Once the profile imports complete (and it may take from several minutes to possibly an hour for thousands of users), you’ll want to check the import log to get a sense on whether it succeeded.  To do so, click the View import log link.  When reading the log, you should know that a PEOPLE_IMPORT content source refers to individual person crawls through your primary import connection, whereas PEOPLE_DL_IMPORT refers to group (i.e. distribution list) crawls.  PEOPLE_DL_IMPORT is also where your secondary import connections through BDC are logged, so it’s relevant to us in the scope of this article.  Here is a part of the log showing both content sources for one user, Andrew Fuller.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image16.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb16.png" border="0" alt="image" width="604" height="76" /></a><br />
<strong>Figure 11: User Profile Import Log</strong></p>
<p>Even though the logs may look fine, you’ll certainly want to verify some of the mapped values come over.  To view one, simply click on View user profiles and select a user.  In Figure 11 below, here are the two mapped properties for synergy\afuller:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/clip-image00191.gif"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/clip-image0019-thumb1.gif" border="0" alt="clip_image001[9]" width="500" height="221" /></a><strong><br />
Figure 12: About me and Hire date values pulled in by profile import</strong></p>
<p>Since I mapped the About me property, you can also see this within the user’s My Profile found in their My site.  Here is Andrew Fuller’s:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image18.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb18.png" border="0" alt="image" width="504" height="166" /></a><br />
<strong>Figure 13: Andrew Fuller’s My Profile page</strong></p>
<p>Now that you have a solid overview of 1:1 mappings, let’s turn our attention to 1:many.</p>
<h4>1:Many Import Connection Type</h4>
<p>While less common than 1:1 connections, a 1:many is handy in a few situations.  Let me give you one example.  As mentioned in the overview section above, the IT group typically manages basic user attributes in AD.  In all my years of consulting, I’ve encountered very few organizations that actually keep these attributes up to date.  The problem is that IT is usually busy handing a myriad of critical problems, and they don’t usually bother updating less important attributes such as someone’s manager.  As long as the permissions are right, that’s what is important to them.</p>
<p>This can cause problems, however.  One of the useful SharePoint profile properties is Manager which gives SharePoint knowledge of the organizational hierarchy.  This was shown in Figure 13 above when looking at Andrew Fuller’s My Profile page.  By default, this property is mapped to the manager setting for the user in AD.  However, if this value is not set or out of date, SharePoint won’t have an accurate picture of the organization.</p>
<p>To correct this problem, we will pull the manager from a Departments table that is stored in our external HR system.  Here is where the 1:many comes in.  Recognize that many users will have the same department.  The idea is that we want to use the department profile property in SharePoint, which is correctly set, and use that to look up into the Departments table (in the external system) to pull the manager for that department.  So, you can think of the 1:many to be for each department there will be many user profiles with that value.</p>
<p>Let me show you how I configure the mapping to pull the Manager property from our HR System.  I start off by adding another Import connection.  Yes, you can have multiple import connections coming from BDC.  I call this one HREmployeesGetManager and here is how it is configured:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image19.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb19.png" border="0" alt="image" width="354" height="323" /></a><br />
<strong>Figure 14: Creating a 1:many import connection</strong></p>
<p>When choosing the 1:many mapping radio button, you have two drop downs to fill in.  You first need to select the filter.  The choices you have will be the filter descriptors that have been made available for the entity’s Finder method.  Hence, to use 1:many mapping, you must have a finder method and at least one filter descriptor.  (Note: if you cannot select 1:many mapping, it is probably because you don’t have filter descriptors defined in your ADF.)</p>
<p>For my demo, here is the Finder method and filter descriptor for the Departments entity:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image20.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb20.png" border="0" alt="image" width="524" height="130" /></a><br />
<strong>Figure 15: Finder method for Departments entity</strong></p>
<p>In the SQL select query, you can see that I am selecting the DepartmentID, DepartmentName and Manager columns based on a certain department name.  The next step is to change the default mapping for the Managers property.  Here is how I have changed it:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image21.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb21.png" border="0" alt="image" width="344" height="97" /></a><br />
<strong>Figure 16: New mapping for Managers profile property</strong></p>
<p>For the Data source field to map, I have pointed this to the Manager column.  Other column choices are the other columns returned from the Finder method.  For the last text box (Manager field string format in AD), you can leave this unchanged.</p>
<p>That’s it.  Run another import, and you should now have your manager property coming from your external HR system.  For this to work, you will need to ensure your Department property is populated for your user profiles.  In my case, this value was still coming from AD.  That’s right, you can use a value that is imported from AD and pass that as a parameter to your BDC connection.  Pretty cool.</p>
<p>Let me make one last point on 1:Many import connections:  Be careful if your Finder method returns more than one record, and your mapped property does not allow multi-values.  For example, perhaps the HR system had two department records with the same name.  And for each record, a different manager is set.  When the import runs and it tries to pull the manager based on the name, two records will be returned. When this happens, the import process will take the first record it finds, and this may not be the one you want.  If you are using a multi-valued property, however, it works nicely and will store the values for all records that are found.</p>
<h4>Troubleshooting Tips</h4>
<p>When troubleshooting import problems, you’ll definitely want to go to the SharePoint logs (by default C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\LOGS).</p>
<p>When mapping, a profile property can be mapped to only one source (primary or secondary).  Similarly, a column from the Specific Finder (1:1 connection) or Finder (1:many connection), can only be mapped once.  For example, if you map the HireDate column to one profile property, you cannot also map it to another.</p>
<p>Remember that you can only map compatible data types.  Fortunately, you will get this error when you try to save your profile property.</p>
<p>When mapping strings, be careful about the column length.  If your profile property only supports 25 characters, and you try to store 50 characters that is the returned value from BDC, you will get an import error for that profile. You would only know this is a problem by seeing this error in the SharePoint logs.  (Note: you cannot change the length of any of the out-of-the-box profile properties.  In this case, you would need to create a new property.)</p>
<p>When creating BDC import connections using the UI, the entity selected from the catalog must expose both Finder and Specific Finder methods.  This is necessary, even if you plan on using only 1:1 or 1:Many connection types.</p>
<h4>Conclusion</h4>
<p>In this article, we covered everything you need to know about importing User Profiles from BDC.  And you now know as much about this as I do. <a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image25.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb25.png" border="0" alt="image" width="16" height="14" /></a></p>
<p>Coming up in Article 7, we will cover the BDC API.  This will allow you to call into the BDC programmatically from your custom applications, web parts, or any other .NET code you need to write.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-6-of-8/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
