Share via


How Do I Synchronize Groups from AD DS to FIM

Applies To: Forefront Identity Manager 2010

One basic requirement for an identity management system is the ability to import and process identity data from an external system. This guide walks you through the main building blocks that are involved in the process of populating Microsoft® Forefront® Identity Manager (FIM) 2010 with group data from Active Directory® Domain Services (AD DS), outlines how you can verify whether your scenario works as expected, provides suggestions for managing Active Directory groups by using FIM 2010, and lists additional sources for information.

Before You Begin

In this section, you will find information about the scope of this document.

In general, “How Do I” guides are targeted at readers who already have basic experience with the process of synchronizing objects with FIM as covered in the related Getting Started (https://go.microsoft.com/FWLink/?LinkId=190486) guides.

Audience

This guide is intended for information technology (IT) professionals who already have a basic understanding of how the FIM synchronization process works and are interested in getting hands-on experience and more conceptual information about specific scenarios.

Prerequisite knowledge

This document assumes that you have access to a running instance of FIM and that you have experience in configuring simple synchronization scenarios as outlined in the following documents:

The content in this document is scoped to function as an extension to these introductory documents.

Scope

The scenario outlined in this document has been simplified to address the requirements of a basic lab environment. The focus is to give you an understanding of the concepts and technologies discussed.

This document helps you develop a solution that involves managing groups in AD DS by using FIM.

Time requirements

The procedures in this document require 120 to 150 minutes to complete.

These time estimates assume that the testing environment is already configured and does not include the time required to set up the test environment.

Getting support

If you have questions regarding the content of this document or if you have general feedback you would like to discuss, feel free to post a message to the Forefront Identity Manager 2010 forum (https://go.microsoft.com/fwlink/?LinkId=189654).

Scenario description

Fabrikam, a fictitious company, is planning to use FIM to manage the group accounts in the corporation’s AD DS by using FIM. As part of this process, Fabrikam needs to synchronize group data to FIM. To start the initial testing, Fabrikam has installed a basic lab environment that consists of FIM and AD DS. In this lab environment, Fabrikam is testing a scenario that consists of a security group that was manually created in AD DS. The objective of this scenario is to synchronize the group to FIM.

Scenario design

To use this guide, you need three architectural components:

  • Active Directory domain controller

  • Computer running FIM Synchronization Service

  • Computer running FIM Portal

The following illustration outlines the required environment.

Required environment

You can run all components on one computer.

Note

For more information about setting up FIM, see the FIM Installation Guide (https://go.microsoft.com/fwlink/?LinkId=165845).

Scenario components list

The following table lists the components that are a part of the scenario in this guide.

Organizational unit icon

Organizational unit

FIM objects – Organizational unit (OU) that is used as a target for the provisioned group.

User account icon

User accounts

  • ADMA – Active Directory user account with sufficient rights to connect to AD DS.

  • FIMMA - Active Directory user account with sufficient rights to connect to FIM.

  • Britta Simon – Sample account in AD DS that is synchronized to FIM.

Security groups icon

Security groups

Test Security Group – Active Directory security group used to test the synchronization logic to FIM.

Management agents and run profiles icon

Management agents and run profiles

  • Fabrikam ADMA – Management agent that exchanges data with AD DS.

  • Fabrikam FIMMA - Management agent that exchanges data with FIM.

Synchronization rules icon

Synchronization rules

AD DS Group Inbound Synchronization Rule – Inbound synchronization rule that synchronizes groups from AD DS to FIM.

Scenario steps

The scenario outlined in this guide consists of the building blocks shown in the following figure.

Scenario building blocks

Configuring the External Systems

In this section, you will find instructions for the resources that you need to create that are outside of your FIM environment.

Step 1: Create the OU

You need the OU as a container for the sample objects. For more information about creating OUs, see Create a New Organizational Unit (https://go.microsoft.com/fwlink/?LinkId=189655).

Step 1
Organizational unit icon

Create an OU called FIMObjects in your AD DS.

Step 2: Create the Active Directory user accounts

For the scenario in this guide, you need two Active Directory user accounts:

  • ADMA - Used by the Active Directory management agent.

  • FIMMA – Used by the FIM Service management agent.

In both cases, it is sufficient to create regular user accounts. More information about the specific requirements of both accounts is found later in this document. For more information about creating users, see Create a New User Account (https://go.microsoft.com/fwlink/?LinkId=189656).

Note

The third account (Britta Simon) is not required at this point. You will get instructions for creating this account later in this document.

Step 2
User account icon

Create two Active Directory user accounts based on the previous description.

Configuring the FIM Synchronization Service

For the configuration steps in this section, you need to start the FIM Synchronization Service Manager.

Creating the management agents

For the scenario in this guide, you need to create two management agents:

  • Fabrikam ADMA – management agent for AD DS.

  • Fabrikam FIMMA – management agent for FIM Service management agent.

Note

Some elementary configuration settings in this section include user related configurations. However, the first test cycle is only for group objects. You will add more specifics about user objects after you have successfully synchronized the group object.

Step 3: Create the Fabrikam ADMA management agent

When you configure a management agent for AD DS, you need to specify an account that is used by the management agent in the data exchange with AD DS. You should use a regular user account. However, to import data from AD DS, the account must have the right to poll changes from the DirSync control. If you want your management agent to export data to AD DS, you need to grant the account sufficient rights on the target OUs. For more information about this topic, see Configuring the ADMA Account (https://go.microsoft.com/fwlink/?LinkId=189657).

When you import group data from AD DS, you should at least select the following attributes:

  • cn or display name – Use to make your groups recognizable. In AD DS, display name is often not set. To ensure that the display name in FIM has a value, you can use the cn attribute.

  • groupType – To get the information about the group type and scope.

  • managedBy – Use to show the owner of the group in FIM.

  • member – To track the members of a group.

  • sAMAccountName – the NetBIOS name of a security group.

Warning

You should examine your AD DS data carefully before configuring imports. Some group management–related attributes such as managedBy and display name often do not have a value.

The following table lists the most important scenario-specific settings that you need to configure.

Management agent designer page Configuration

Create management agent

  1. Management agent for: AD DS

  2. Name: Fabrikam ADMA

Connect to Active Directory forest

  1. Select directory partitions: “DC=Fabrikam,DC=com”

  2. Click Containers to open the Select Containers dialog box and ensure that FIMObjects is the only OU that is selected.

Select Object types

In addition to the already selected Object types, select group.

Select attributes

  1. Click Show All.

  2. Select the following attributes:

    • displayName

    • groupType

    • managedBy

    • member

    • sAMAccountName

Step 3
Management agents and run profiles icon

Create the management agent based on the previous description.

Note

For more information, see the following topics in Help:

  • Create a Management Agent

  • Connect to an Active Directory Forest

  • Using the Management Agent for Active Directory

  • Configure Directory Partitions

Step 4: Create the Fabrikam FIMMA management agent

When you configure a FIM Service management agent, you need to specify an account that is used by the management agent in the data exchange with the FIM Service.

You should use a regular user account. The account must be the same account as the one you specified during the installation of FIM. For a script that you can use to determine the name of the FIMMA account that you specified during setup and to test whether this account is still valid, see Using Windows PowerShell to Do a FIM MA Account Configuration Quick Test (https://go.microsoft.com/fwlink/?LinkId=189659).

The following table lists the most important scenario-specific settings you need to configure.

Management agent designer page Configuration

Create management agent

  1. Management agent for: FIM Service Management Agent

  2. Name: Fabrikam FIMMA

Connect to database

Use the following settings:

  • Server: localhost

  • Database: FIMService

  • FIM Service base address: https://localhost:5725

Provide the information about the account you created for this management agent.

Select Object types

In addition to the already selected Object types, select Group and Person.

Configure Object type mappings

In addition to the already existing object type mappings, add the following Data Source Object Type to Metaverse Object Type mappings:

  • Group to group

  • Person to person

Configure attribute flow

In addition to the already existing attribute flow mappings, add the following attribute flow mappings:

Screen shot of attribute flow mappings
Step 4
Management agents and run profiles icon

Create the management agent based on the previous description.

Note

For more information, see the following topics in Help:

  • Create a Management Agent

  • Connect to an Active Directory Database

  • Using the Management Agent for Active Directory

  • Configure Directory Partitions

Step 5: Create the run profiles

The following table lists the run profiles you need to create for the scenario in this guide.

Management agent Run profile

Fabrikam ADMA

  1. Full import

  2. Full synchronization

  3. Delta import

  4. Delta synchronization

  5. Export

Fabrikam FIMMA

  1. Full import

  2. Full synchronization

  3. Delta import

  4. Delta synchronization

  5. Export

Step 5
Management agents and run profiles icon

Create run profiles for each management agent according to the previous table.

Note

For more information, see the Create a Management Agent Run Profile in FIM Help.

Important

Verify that provisioning is enabled in your environment. You can do this by running the script, Using Windows PowerShell to Enable Provisioning (https://go.microsoft.com/fwlink/?LinkId=189660).

Configuring the FIM Service

For the scenario in this guide, you only need to configure an inbound synchronization rule. The following section provides information about the configuration of the synchronization rule.

Step 6: Create the synchronization rule

When you create the inbound synchronization rule for your Active Directory groups, you need to add a flow mapping for the domain attribute. Populating the domain attribute is a challenge because domain is not an attribute of a group. When this attribute is required in AD DS, the directory service has to look up the value from the configuration container.

The following illustration shows an example of a domain partition in the configuration container.

Screen shot of domain partition

One method used to populate the domain attribute is to implement a lookup table that determines the attribute value based on the current SID of an object. The SID attribute is a good attribute for this purpose because the value of this attribute only changes when the domain membership of an object changes.

The SID attribute of an object in AD DS consists of the domain SID plus an extension called a relative identifier (RID), the unique identifier of an object within the domain database. If you know what the value of the domain SID is, you can use this value in comparison with the SID value of an object to determine the value of the domain attribute as a custom expression.

FIM provides a built-in function you can use to translate a binary SID into a string representation. The name of this function is ConvertSidToString. This function returns the string representation of a SID as domain SID + RID.

For an equality comparison (Eq) of a user's SID and the domain SID, you need to remove the RID part from the user's SID. Because you know the value of the domain SID, you also know the domain SID length. You can use the length of the domain SID to calculate the part of a user's SID that you need for an equality comparison.

The following example outlines how you can use the domain SID and the user's SID to calculate the domain value with a custom expression in FIM.

A lookup of Fabrikam's SID returns the following value:

“S-1-5-21-4220550486-1538840966-3184992408”

The SID string has a length of 41.

The first step in your custom expression is to translate the object's SID into a string representation by using the ConvertSidToString method:

ConvertSidToString(objectSid)

From this string, you only need the first 41 characters from the left:

Left(ConvertSidToString(objectSid), 41)

The question is whether this string is equal to the domain SID:

Eq(Left(ConvertSidToString(objectSid), 41)

If both values match, you can flow “FABRIKAM” as the domain name into the metaverse. If the values do not match, you should flow something like “Unknown”:

IIF(Eq(Left(ConvertSidToString(objectSid),41),”S-1-5-21-4220550486-1538840966-3184992408”),”FABRIKAM”,”Unknown”)

The FIM ScriptBox provides a script that automatically calculates the required custom expression string for the domain attribute value calculation. The script is available in the article Using Windows PowerShell To Generate The Custom Expression For The Domain Attribute Flow (https://go.microsoft.com/FWLink/?LinkId=190482).

The script requests the required information from a target domain controller, translates the domain information into a CustomExpression, and stores the result in the clipboard.

In AD DS, each group has a type and a scope. The group type is either security or distribution. Each group type can have three different scopes:

  • Domain local

  • Global

  • Universal

The following screen shot shows the related configuration dialog box for groups in AD DS.

New Object dialog box

The FIM schema defines two separate attributes to track the type and the scope information of a group. However, in AD DS, only one attribute, groupType, is used to track this information.

When you configure an outbound synchronization rule for AD DS, you need to configure an outbound attribute flow mapping that merges the values for the type and the scope into one attribute value.

To calculate the required groupType value, you can use the following table.

Type Scope GroupType

Distribution

Global

Domain local

Universal

2

4

8

Security

Global

Domain local

Universal

-2147483646

-2147483644

-2147483640

In FIM, the type and the scope of a group are tracked in separate attributes. When you synchronize a group from AD DS to FIM, you need to calculate the FIM attribute values from the groupType attribute in AD DS.

The groupType attribute in AD DS is a bit vector, which means that the same bits are used in the security and the distribution group to define the scope of a group. When you need to determine the scope of a group, you can simply do this by applying a BitAnd operation to the groupType attribute. The following table lists the calculation results of a BitAnd, the groupType, and a value X.

BitAnd(X, groupType) Scope

2

Global

4

Domain local

8

Universal

Because the bits 2, 4, and 8 are used in security groups and distribution groups to define the scope, you can use the bit mask of 2 + 4 + 8 to calculate the type of a group. If a BitOr operation of the groupType and the mask value 14 returns a 14, the processed object is a distribution group.

When you import unmanaged group information from AD DS into FIM, you need to initialize the membershipLocked attribute. The best practice recommendation is to set this attribute to false.

The next attribute that you need to initialize is the membershipAddWorkflow attribute that should be set to Owner Approval.

The following tables show the configuration of the related inbound synchronization rule.

Synchronization rule configuration

Name

Fabrikam Group Inbound Synchronization Rule

Description

Precedence

1

Data Flow Direction

Inbound

Dependency

Scope

Metaverse Resource Type

group

External System

Fabrikam ADMA

External System Resource Type

group

Relationship

Create Resource In FIM

True

Relationship criteria

ILM Attribute

accountName

Data Source Attribute

sAMAccountName

Inbound attribute flows

Destination

Source

displayName

displayName

scope

CustomExpression(IIF(Eq(BitAnd(2,groupType),2),”Global”,IIF(Eq(BitAnd(4,groupType),4),”DomainLocal”,”Universal”)))

type

CustomExpression(IIF(Eq(BitOr(14,groupType),14),”Distribution”,”Security”))

member

member

accountName

sAMAccountName

membershipLocked

Constant: false

membershipAddWorkflow

Constant: Owner Approval

domain

CustomExpression(IIF(Eq(Left(ConvertSidToString(objectSid),41),”S-1-5-21-4220550486-1538840966-3184992408”),”FABRIKAM”,”Unknown”))

Step 6
Synchronization rules icon

Create a synchronization rule according to the data in the previous tables.

Important

Verify that you have selected Initial Flow Only for the attribute flow that has the DN as the destination.

Initializing your Environment

The objectives of the initialization phase are as follows:

  • Enable the required management policy rules (MPRs) for group synchronization.

  • Bring your synchronization rule into the metaverse.

  • Bring your Active Directory structure into the Active Directory connector space.

Step 7: Enable MPRs

To synchronize group objects in your environment, you need to enable the following MPRs.

Display name

Synchronization: Synchronization account can read group resources it synchronizes

Synchronization: Synchronization account controls group resources it synchronizes

Step 7
Management policy rules

Enable the MPRs listed in the previous table.

Step 8: Run the run profiles

The following table lists the run profiles that are part of the initialization phase.

Run Management agent Run profile

1

Fabrikam FIMMA

Full import

2

Full synchronization

3

Export

4

Delta import

5

Fabrikam ADMA

Full import

6

Full synchronization

Step 8
Management agents and run profiles icon

Run the run profiles according to the previous table.

Note

You should verify that your outbound synchronization rule has been successfully projected into the metaverse.

Testing the Configuration

The objective of this section is to test your actual configuration. To test the configuration, you:

  1. Create a sample security group in AD DS.

  2. Synchronize the AD DS group into FIM.

Step 9: Create a sample security group in FIM

The following table lists the properties of the sample security group.

Attribute Value

Group Name

Test Security Group

Group Name (pre Windows 2000)

Test SG

Group Scope

Universal

Group Type

Security

Step 9
Security groups icon

Create a sample security group according the data in the previous table.

Step 10: Synchronize the AD DS group into FIM

Before you start the first synchronization cycle for a test object, you should track the expected state of your object after each run profile that you run in a test plan. Your test plan should include next to the general state of your object (created, updated, or deleted) also the attribute values that you expect. Use your test plan to verify your test plan expectations. If a step does not return the expected results, do not proceed to the next step until you have resolved the discrepancy between your expected result and the actual result.

To verify your expectations, you can use the synchronization statistics as a first indicator. For example, if you expect new objects to be staged in a connector space, but the import statistics returns no “Adds,” there is obviously something in your environment that does not work as expected.

Screen shot of synchronization statistics

While the synchronization statistics can give you a first indication of whether your scenario works as expected, you should use the Search Connector Space and the Metaverse Search feature of the Synchronization Service Manager to verify the expected attribute values.

To synchronize the group to FIM

  1. Import the security group into the AD MA connector space.

  2. Project the security group into the metaverse.

  3. Provision the security group to the FIM connector space.

  4. Export the security group to FIM.

  5. Confirm the creation of the security group.

To accomplish these tasks, you run the following run profiles.

Management agent Run profile

Fabrikam FIMMA

  1. Delta import

  2. Delta synchronization

Fabrikam FIMMA

  1. Export

  2. Delta import

After the delta import from AD DS, the synchronization statistics report one new object.

Screen shot showing new object after delta import

The objective of the delta synchronization run on your Fabrikam FIMMA is to perform several operations:

  • Projection – The new security group object is projected into the metaverse.

  • Provisioning – The newly projected group object is provisioned into the connector space of the FIM MA.

  • Export Attribute Flows – The newly provisioned object is initialized with the attribute values according to the configuration.

Screen shot showing synchronization statistics

Step 10
Management agents and run profiles icon

Run the run profiles according to the instructions in this section.

Warning

Each run profile run must succeed without an error.

Step 11: Verify the provisioned security group in FIM

To verify that your sample user has been synchronized to FIM, open the related object in the FIM Portal.

Screen shot of sample user in FIM Portal

Step 11
Organizational unit icon

Verify that your sample security group exists in the FIM Portal.

Extending your group synchronization logic

Because you have successfully synchronized a group object from AD DS to FIM, you are now ready to add more components to your synchronization logic. As a first step, you should add group members to your security group.

The membership in a group is tracked in an attribute called a member, a multivalued reference attribute. When you synchronize reference attributes in FIM, you need to ensure that both objects, the referencing attribute as well as the referenced attribute, are available in all layers of the synchronization service. The FIM Synchronization Service preserves existing reference relationships and also enforces referential integrity. This means that the FIM Synchronization Service ensures that the references of referencing objects are pointing to valid objects.

The following illustration outlines this process using the member attribute of a group.

Shows referential integrity from AD to FIM

Keeping references intact across the various data layers (connector space, metaverse, external system) involves a transformation of the reference value into a format that is used by each layer. For example, in FIM, references are expressed in the form of GUID values. However, in AD DS, reference values are implemented in the form of DNs. During a synchronization run and also during an import from and an export to a data source, the synchronization engine applies the necessary transformation of the reference values. While groups can contain groups as members, which is also known as group nesting, a group can also have users as members. To preserve the references that point to user objects, you need to extend your synchronization logic with the components that are required to synchronize user objects.

For the required deployment instructions for synchronizing user objects in your environment, see How Do I Synchronize Users from Active Directory Domain Services to FIM (https://go.microsoft.com/fwlink/?LinkId=190484). You should extend your group synchronization scenario with the user synchronization logic that is outlined in this document.

After implementing the synchronization logic for users, you should add the sample user Britta Simon as a member to the security group. After a synchronization cycle to FIM, you find that Britta Simon is a member of the group in FIM.

Screen shot of member in FIM Portal

For more information about reference attributes, download the following document:

Design Concepts for Managing Reference Attributes (https://go.microsoft.com/fwlink/?LinkId=189666)

When you synchronize group objects from AD DS to FIM, there are two more attributes that require your attention in the FIM Service:

  • DisplayedOwner

  • Owner

Screen shot of attributes in FIM Portal

While you can synchronize group objects from AD DS to FIM without populating values for these attributes, they are technically required by FIM so that the group is manageable within FIM, specifically:

  • An Owner-approval group needs an owner so that they can manage membership in the group.

  • FIM requires that the Displayed Owner is a member of the Owner group.

One option that you have is to populate both attributes based on the managedBy attribute in AD DS. However, this method may require additional updates to your AD DS because managedBy is often not populated in AD DS.

Another method is the configuration of workflows in FIM to initialize the attributes when a new group object has been imported from AD DS into FIM. Using workflows to initialize attribute values can have an impact on your environment when a large amount of objects has been imported from AD DS. You should keep this in mind when you perform bulk imports of new objects from AD DS.

The third method to initialize these values is a scripted approach based on the FIM Windows PowerShell™ cmdlets. By using the scripted method, you can retrieve a list of the affected objects, set the values that you want, and import them back into your FIM Service data store. The tradeoff of the scripted method is the required manual interaction that can be time consuming.

Summary

Synchronizing group objects from AD DS into FIM is a relatively simple task from a configuration perspective. The only bigger challenge is the population of the domain attribute because this attribute is not directly associated with an object in AD DS and needs to be calculated. In this document, you have been introduced to a method that uses an object's SID attribute value and a lookup table for the calculation of the value.

When using this method, keep in mind that a change to your domain infrastructure such as renaming existing domains or adding new domains requires an update to the calculation logic in your inbound synchronization rule. Updates to synchronization rules require full synchronization runs that can be time consuming to process in your environment.

An alternative to populating the domain attribute in a synchronization rule is the implementation of workflows to do this task. However, initializing attribute values by using workflows has an impact on the performance of your system. The performance impact of bulk imports from AD DS can be significant.

In general, when implementing inbound synchronization rules in your environment, you need to differentiate between two scenarios:

  • Initialization of objects from AD DS

  • Regular imports from AD DS objects

The initialization phase requires special care in your planning. In this phase, FIM is populated by a bulk import with existing objects from AD DS. This scenario can have a significant impact on both the servers in your external systems and your servers running FIM. If you have a large number of objects that you need to synchronize from AD DS into FIM, you should investigate options that can limit this process such as:

  • Limiting the number of objects that are processed during one import run from AD DS. This option is a recommended best practice.

  • Modifying the partitions and container filters to decrease the number of objects that are processed in one run.

  • Exporting your AD DS objects by using, for example, LDIF and importing them into FIM by using the FIM Windows PowerShell cmdlets.

Each method has pros and cons. You need to determine the method that works best for you in your test environment.

Another aspect of handling the initialization phase is the subject of attribute flow precedence. During the initialization phase, you may need to make AD DS authoritative for attributes for which you want FIM to be authoritative after the initialization phase. This means that you need to configure the attribute flow precedence in a way that enables your AD MA to flow attribute values into FIM that, later in your deployment, will be controlled by FIM.

In general, you should develop a plan that includes a solution for the initialization phase for your environment.

For the scenario in this document, the samAccountName attribute is used to join related identity objects. However, in many scenarios, this attribute is not the optimal solution because the samAccountName attribute is only required to be unique on a per domain basis. The best attribute to implement robust joins is a unique identifier called Correlation ID. There are several options to implement a Correlation ID in a production environment. You can find more information about this topic in the document “Design Concepts for Correlating Digital Identities.” You can download this document by visiting the ILM 2007 Design Concepts (https://go.microsoft.com/FWLink/?LinkId=190485) page.

When you are in the process of planning your deployment, you should investigate an option to extend the Active Directory schema with an attribute that stores a Correlation ID.

If you want FIM to eventually be authoritative for the object management in your environment, you can use the already existing GUIDs of the FIM objects as the source for your Correlation ID.

In addition to implanting a method for robust joins in your environment, a Correlation ID is helpful to detect managed objects in your AD DS. If an object has a value for this attribute, you know that this object is managed by FIM.

See Also

Other Resources

Using FIM to Enable or Disable Accounts in Active Directory
About Reference Attributes
ILM 2007 Design Concepts
How Can I Manage My FIM MA Account
Detecting Nonauthoritative Accounts – Part 1: Envisioning
The Poor Man’s Version of a Connector Detection Mechanism
Configuring the ADMA Account
A Method to Remove Orphaned ExpectedRuleEntry Objects from Your Environment
About Attribute Flow Precedence
About Exports