SharePoint 2007: BDC - User Profiles

Posted on 4/24/2007 @ 5:19 AM in #SharePoint by | Feedback | 64062 views


SharePoint 2007: BDC - The Business Data Catalog

This post is in continuation to a series of blogposts I put up on BDC - the Business Data Catalog.

Table of Contents:

  • Introduction
  • In-built Webparts
  • Lists with Business data type columns.
  • Search
  • User Profiles <-- You are here
  • Other custom applications targeting a common runtime object model.
  • Making it easier to author XML Applications: BDCMetaMan
  • So here is the #1 most important thing to consider about importing user profiles from BDC. BDC cannot act as the primary source for user profile information. BDC can only work as a supplementary data source, in other words, you must have an import connection setup with say Active Directory or something else, before you can choose to supplement that information from BDC. BDC cannot be your master import connection.

    This has various implications depending upon your setup. For instance (and this is just an instance), if you are using custom forms authentication, chances are, you wouldn't want to import profiles from an Active Directory. Hey, if you choose to use Forms Auth, there is a pretty darned good chance that your user profile data store isn't the AD anyway. And if that is the case, in order to supplement the user profile information, you would like to/want to setup a BDC application as the data source, but it's not gonna work. You will instead have to write a custom application to import that information.

    Okay good, now once I have that out of my system, here is how you would use BDC to act as a supplementary data source for your user profile information.

    1. First, the test environment you will need must be a a sharepoint server in a domain. Once you have that setup, go ahead and setup user profile import.
    2. Now, let us assume that you have "City" information for your users in the Northwind app. Each user in your sharepoint setup corresponds to a customer in northwind (I am totally making this up of course). And what you'd like to do is, find the appropriate customer (entity) from the BDC you have already setup, and look up the city from the entity, and plop that into a property called "NorthwindCity". Here is how you'd do that.
      1. Under the SSP, go to User Profiles and My Sites/User profiles and properties.
      2. Click on "Add profile property". Add a new property called "NorthwindID". The point being, each user profile will already have a NorthwindID populated, and this information will be used to match-up with the entity's identifier. This will allow me to call the SpecificFinder on the entity, and retreive other details about a specific entity.
      3. Next, back in User Profiles and Properties, go to "View Import connections". Click "Create New Connection".
      4. Create a new connection called NorthWind that is based on the BDC. Choose to target Customer (NorthwindTraders). To keep things simple, use a 1:1 mapping, and choose "Return Items identified by this profile property: NorthwindID". (You see what I'm getting at here? read step #2 again).
      5. Next, add another profile property called NorthwindCity. BUT, at the bottom of the page, set up "Property Import Mapping" to look like this -

        So essentially what you are saying is, the "NorthwindCity" property will be populated by not the master import connection but, the Northwind connection. This is what you setup in step #4. Also, when you do import from the Northwind connection, map the City of the Entity to NorthwindCity.
      6. Now, go back to any profile you like in the SSP, and setup a dummy test entity. Change it's NorthwindID to "ALFKI".
      7. Now back in the SSP/User Profiles and Properties, click on "Start full import".
      8. Go back to the entity you setup the NorthwindID in step #6. Assuming that your BDC is setup properly, you will see that the NorthwindCity has been populated to "Berlin".

    Sound off but keep it civil:

    Older comments..


    On 4/16/2007 1:18:09 PM David Gilbert said ..
    Great blog! Keep it up.

    Question: Since we can't add user profiles unless they are in AD or LDAP, how would I add profiles for external users? (from a ASP.NET SQL DB source, for example). I need to target content via audiences to these users, so I need the profiles.

    Thanks!


    Dave


    On 4/16/2007 2:06:35 PM Sahil Malik said ..
    Thanks Dave. I have written a few open source projects for this purpose. They are on codeplex, you can search my blog for them.

    SM


    On 5/15/2007 4:43:52 AM Fran├žois Lebion said ..
    Nice posts ;)

    But I can't make the 1-1 relation.

    My AD have distinguishedname as primary key.


    I've created a table with a column named NameID which is the distinguishedname of my AD.


    I've added some other columns to test.

    I've created and tested a BDC. It works, I can search for record for a specific distinguishedname (NameID).

    I've followed the points of this post.


    - I've added a property called NameID (string 150)


    - I've added a connection with my bdc and specified NameID in the dropdown


    - I've added a property TOTO mapped to my TOTO column.


    - I've started a full import

    But when I view my profiles, I see 2 custom properties at the bottom (NameID and TOTO), these properties are blank :(

    Can you tell me If I forgot something? I've retried 3 times...but doesn't work :(

    Thanks,

    Fran├žois


    On 3/25/2008 2:22:04 AM arun said ..
    Hi,

    I have tried to import profile property from SQL server using the same technique mentioned above.


    I gave 1:1 mapping for the BDC connection.


    But, even after the full import , the property is not getting populated.


    Need some pointers on this issue asap!!


    On 4/11/2008 5:34:50 AM Jason said ..
    I waws having the same problem. the solution was to grant the service account that wss is running on access to the BDC.

    SharedServices > Business Data Catalog Applications > "BDC Name" > Manage Permissions

    i granted the service account "Execute, Selectable in clients". Not sure if it's best practice, but it worked.


    On 6/5/2008 2:26:01 AM sven said ..
    So based on your article I can use AD to initially get some data into profiles. I can then supplement the profile data with some additional profile data I have in a 2nd database. Got that part.


    How do I handle the scenario where the profile database (not AD) has "users" that dont exist in AD, for example, conference rooms, printers, even people who dont require network access. While these people wont be logging on :-) , we still want this data to show up in our people search.


    Can I include records in the profile from my 2nd database that arent in AD?


    On 6/11/2008 1:10:14 PM Kunal said ..
    Great Post. Exactly what I needed to do with BDC. Maybe i'll run in to you sometimes at the capArea sharepoint SIG


    On 6/26/2008 9:18:18 AM Richard Edwards said ..
    I had trouble with the import. Was getting "Exception occured when calling into BIL connector for import from non master data source" so I had to give the account I use to access the BDC application Manage User Profiles permissions.

    To check permissions for this account, go to the SSP Admin, User Profiles and My Sites > Personalization services permissions. Make sure this account is listed with Manage User Profiles permissions.


    On 8/15/2008 4:34:25 PM Sree said ..
    I did the 1:1 mapping, works great except for those users whose matching key is in different case in AD and other repository where I did the BDC. ex: samAccountName in AD is BESTBUY\biGboY and in other repository it is BESTBUY\bigboy

    Any feedback will be very helpful. Thanks in advance.


    On 8/29/2008 2:41:30 AM suja said ..
    great post to understand BDC!!


    Hey is it possible to populate my custom user property column from a database column using BDC?


    for eg if I have 'City' as a database table column, then populate the custom property, with all the city values so that users can pick one of these cities while editing the user profiles?


    On 9/8/2008 12:07:53 PM Hittu said ..
    Is it possible to change the user profile settings globally. My need is to display the welcome message as "Welcome firstname Lastname" instead of "Welcome userId" for all the users. Where can I change the settings to reflect this change? Also I would like to mention that the user profiles are getting populated throgh AD, and I am using MOSS.


    On 12/13/2008 12:32:50 PM salman said ..
    Hi,


    Thanks for the great post.


    I am working as a SharePoint consultant. Now my client has the Postgresql database. They have the table named XYZ. Which has usernames and passwords. We want that table to be used for SharePoint authentication. We are using MOSS 2007. Please guide me thru this.


    On 7/31/2009 7:19:23 AM myro said ..
    hello,


    thank you for your article.

    I was thinking if BDC are really the best choise for profile properties updates.


    Creating BDC xml files is preatty complex and they are not really flexible if you need to add extra logic.

    I have always prefered to create SharePoint's Timed jobs and do profiles updates using sharepoint's object model.

    I've posted a code snippet on my blog: http://www.myrocode.com/post/2009/07/30/Update-profiles-property-in-SharePoint-2007-programmatically-without-BDC.aspx

    don't you think that could be easier to solve profiles imports programmatically?


    On 1/29/2010 5:13:49 AM Shailendra said ..
    Really found the article a great one.


    Can we use BDC to import users from the Dynamic AX.


    Please guide if this is possible using BDC.

    Shailendra