Creating a Profile Definition with Two Data Sources

The steps outlined in this section describe a scenario for creating a user profile definition that stores data in both a SQL Server database and an Active Directory database. This scenario is meant only to describe the process; do not use the actual profile described. You should design your profile definitions based on your business requirements.

Ee825428.note(en-US,CS.20).gifNote

  • Your Commerce Server 2002 Active Directory domain controllers must be installed and configured before you can complete the following steps. For information about planning for Active Directory, see Planning for Active Directory Integration.

To create a profile definition with two data sources, you perform the following steps:

  • Step 1: Create the ProfileService_ADSource Data Source
  • Step 2: Add the Active Directory User Object
  • Step 3: Add Data Members to the Active Directory User Object
  • Step 4: Create the Active Directory-SQL Server User Profile Definition
  • Step 5: Add Property Groups to the Active Directory-SQL Server User
  • Step 6: Add SQL Server Properties to the Active Directory-SQL Server User

Step 1: Create the ProfileService_ADSource Data Source

  1. On the SQL Server/Commerce Server computer, expand Commerce Server Manager, expand Global Resources, expand Profiles, expand Profile Catalog, right-click Data Sources, and then click New Data Source.
  2. In the New Data Source dialog box, do the following:
    Use this To do this
    Name Type UPM_ADSource_test.
    Display Name Type ProfileService_ADSource_test.
    Description Type Active Directory data source.
  3. Click Next.
  4. In the Data Source dialog box, in the Source Type drop-down list, select LDAPv3-Compliant Source, and then click Next.
  5. In the Partitions dialog box, make sure the Partitioned Data Source check box is not selected, and then click Add.
  6. In the Partition dialog box, click Edit.
  7. In the LDAP Connection String dialog box, do the following:
    Use this To do this
    Server Type the name of the Active Directory domain controller. In this example, the name is MSCS01.
    Port Leave blank (unless you are using a value other than 389).
  8. Click OK.
  9. In the Partition dialog box, make sure that the Default Partition check box is not selected.
  10. In the Partition dialog box, do the following:
    Use this To do this
    User Name Type your Microsoft Windows domain and user name for the Active Directory domain. Type it in the form domain\username.
    Password Type your Windows domain password.
  11. Click Next.
  12. In the System Attributes dialog box, do the following:
    Use this To do this
    Parent URL Type the location on the Active Directory server where you want your Active Directory data to be stored relative to the root.
    Domain Name Type the domain name of the Active Directory server.

Ee825428.note(en-US,CS.20).gif Note

  • Do not change the default settings for the other options in the dialog box. The one exception is, you might want to select the Use the same credentials for all users option. This option forces the Profiles resource to use the credentials you entered in step 7 whenever it communicates with the Active Directory server. If you do not select this option, the Profiles resource uses the credentials of the process in which it is currently running.
  1. Click Next.
  2. In the Custom Attributes dialog box, click Finish.
  3. In the Partitions dialog box, click Finish.

The ProfileService_ADStore partition appears as a new node under Data Sources in Commerce Server Manager.

Step 2: Add the Active Directory User Object

You create a profile data object to map a profile property to the Active Directory user class.

  1. Expand Commerce Server Manager, expand Global Resources, expand Profiles, expand Profile Catalog, expand Data Sources, expand the ProfileService_ADSource_Test data source you created in the previous procedure, right-click Data Objects, and then click New Data Object.
  2. In the New Data Object dialog box, do the following:
    Use this To do this
    Object Name Select user. This is the Active Directory user class.
    Display Name Type AD User Object.
  3. Click OK.

The AD User Object data object is added to the ProfileService_ADSource_test data source.

Step 3: Add Data Members to the AD User Object

You create a profile data member to map a profile property attribute to a column in a table in the database you mapped the data source to. In this example, we will add nine data members to the AD User Object data object created in the previous procedure. These members are for the user name, user password, and common name.

  1. Expand Commerce Server Manager, expand Global Resources, expand Profiles, expand Profile Catalog, expand Data Sources, expand ProfileService_ADSource_test, right-click AD User Object, and then click New Data Member.

  2. In the New Data Member dialog box, do the following:

    Use this To do this
    Member Name Select cn.
    Display Name Type Common Name.
  3. Click Add.

    By default, the cn data member is marked as Required, Indexed, and Primary key.

    Ee825428.note(en-US,CS.20).gifNote

    • The SAMAccountname data member is required for every instance of user class or any other class derived from the user class for the Active Directory data source. The SAMAccountname data member is a string property, and it must be unique.
  4. Repeat this procedure to add the following data members:

    Member name Display name Type
    SAMAccountname Security Account Manager Account name String
    givenName First Name String
    Initials Initial String
    sn Last Name String
    streetAddress Street Address String
    City City String
    St State/Province String
    postalCode Postal Code String
    co Country/Region String
  5. Click Finished.

Step 4: Create the Active Directory-SQL User Profile Definition

You use the AD User Object data object to create your custom profile definition. This profile definition will collect user profile information. Most of the properties will be mapped to a SQL Server database. The user name and password will be mapped to Active Directory.

You create this multiple-source profile by selecting the properties you want and mapping them to data members from different data sources.

  1. Expand Commerce Server Manager, expand Global Resources, expand Profiles, expand Profile Catalog, expand Data Sources, expand ProfileService_ADSource_Test, expand Data Objects, right-click AD User Object, point to New, and then click New Profile_Definition.
  2. In the New Profile Definition dialog box, do the following:
    Use this To do this
    Name Type AD_SQL_User.
    Display Name Type AD-SQL User.
    Description Type User profile definition using AD and SQL sources.
  3. Click Next.
  4. In the Custom Attributes dialog box, click Finish. (No custom attributes are created for this example.)

The new profile definition appears in the list of available profile definitions in Commerce Server Manager.

Step 5: Add Property Groups to AD-SQL User

To make your profile definition easier to read, you can create separate groups for your Active Directory and SQL Server properties. Before you add the SQL Server properties to your AD-SQL User profile definition, create the data groups.

  1. Expand Commerce Server Manager, expand Global Resources, expand Profiles, expand Profile Catalog, expand Profile Definitions, and then click AD-SQL User. The Properties list appears in the right pane.
  2. Click Add.
  3. In the Add -- Web Page dialog box, select Add a new group, and then click OK.
  4. In the Attributes section, do the following:
    Use this To do this
    Name Type ADGroup.
    Display Name Type Active Directory.
  5. Click Apply.
  6. In the Properties list, select Active Directory, the group you just created, and then click the Up Arrow button at the bottom of the dialog box. Keep clicking it until Active Directory is moved to the top of the Properties list, above all of the other properties.
  7. Click the directional arrow to the left of Active Directory so that it points down. This expands the node, and prepares the group to accept properties.
  8. Click the first property underneath Active Directory. If you followed the preceding procedures exactly, this will be the Common Name property.
  9. Click the Up Arrow button at the bottom of the dialog box. The property name appears indented under Active Directory. This places the property in the Active Directory group.
  10. For each of the remaining properties, select its name and click the Up Arrow button.
  11. To add the SQL Server group to the property definition, click the Add button.
  12. In the Attributes section, do the following:
    Use this To do this
    Name Type SQLGroup.
    Display Name Type SQL Server.
  13. Click Apply.
  14. To move the SQL Server group name to the left, click the Down Arrow at the bottom of the dialog box.

The properties you added are organized in the new property groups.

Step 6: Add SQL Server Properties to AD-SQL User

You have created a profile definition named AD-SQL User that has two property groups: Active Directory and SQL Server. You have already included the Active Directory properties. Next, you need to add the SQL Server properties.

  1. Expand Commerce Server Manager, expand Global Resources, expand Profiles, expand Profile Catalog, expand Profile Definitions, and then click AD-SQL User.

  2. In the profile definition screen, in the Properties list, click Common Name. The property attributes appear to the right.

  3. In the Advanced Attributes section, do the following:

    Use this To do this
    Key Type Select Dual (Primary and Join). When using multiple data sources in a profile definition, it is necessary to create a join key that maps to both sources.

    Ee825428.important(en-US,CS.20).gif Important

    • After you save a join key, you cannot change it at a later date.
    Map to Data Click the ellipsis [...] button. In the Data Source Picker dialog box, expand ProfileService_ADSource_test, and then expand AD User Object. Select ProfileService_ADSource, and then select User Object. Expand ProfileService_ADSource_test and then select User.
  4. Hold down the CTRL key and select both u_logon_name (located under User Object), and cn (located under AD-SQL User), and then click OK to close the Data Source Picker dialog box.

    Both properties appear in the Map to Data box.

  5. In the Advanced Attributes section, select the RDN box, and then click Apply.

    The join key properties are designated as the Relative Distinguished Name (RDN) for the profile. The RDN must exist to create a valid profile that is mapped to an LDAPv3 source, such as Active Directory. (This is not required for OLE DB sources, such as SQL Server.)

  6. In the Properties list, click the directional arrow to the left of SQL Server, and then click Add.

  7. In the Add -- Web Page dialog box, select Add a new property, and then click OK.

  8. In the Properties list, select New Property 1.

    Add the properties in the following New Properties table to the AD-SQL User profile definition.

    Name Display name Type Map to data
    u_user_security_password Password String Password
    i_account_status Account Status Number Account Status
    u_user_catalog_set Catalog Set String User Catalog Set
    d_data_registered Date Registered Date/ Time Date Created
    i_partner_desk_role Partner Service Role Number Partner Service Role
    d_date_last_changed Date Last Changed Date/ Time Date last changed
  9. In the Attributes section, do the following:

    Use this To do this
    Name Type the programmatic name for the property from the Name column in the previous table.
    Display Name Type the display name for the property from the Display name column in the previous table.
    Type Select from the drop-down list the property type for the property from the Type column in the previous table.
  10. In the Advanced Attributes section, click the Map to Data ellipsis [...] button. Navigate to SQLServerUser Object, and then select the data member for the property from the Map to data column in the previous table.

  11. To apply the changes you made to the property, click Apply.

  12. Repeat Steps 7 through 11 until you have added all of the properties in the New Properties table.

  13. To save the profile definition, click Ee825428.save(en-US,CS.20).gif on the toolbar.

If you used the AD-SQL User profile definition on your Web site, it will store data in both a SQL Server database and an Active Directory database.

Copyright © 2005 Microsoft Corporation.
All rights reserved.