Step 7: Create Metaverse Rules Extension

By enabling provisioning we will allow our objects in our delimited file ma to be provisioned into the connector space of our ECMA 2.0 and then subsequently to be exported to our xml file. Creating the Metaverse Rules Extension consists of the following:

  • Create the metaverse rules extension binary

  • Enable Provisioning

Create the metaverse rules extension binary

Now we will create our metaverse rules extension binary. This will be done using the code provided.

To create the new management agent binary

  1. In the Synchronization Service, at the top, select Tools and then click Options. This will bring up the Options screen.

  2. In options, place a check in Enable metaverse rules extension. This will allow the Create Rules Extension Project button to become enabled.

  3. Click Create Rules Extension Project. This will bring up the Create Extension Project dialog.

  4. In the Create Extension Project dialog box, next to Programming Language: select Visual C#

  5. In the Create Extension Project dialog box, next to Visual Studio Version: select Visual Studio 2010.

  6. MV Rule 1

  7. Click OK. This will launch Visual Studio 2010.

  8. On the right, at the top, under the Solutions Explorer, double-click MVExtension.cs. This will open the file with code that has already been written.

  9. Scoll down to void IMVSynchronization.Provision (MVEntry mventry)

  10. . Remove the comments and add the code below

    ConnectedMA ManagementAgent;
                int Connectors = 0;
                CSEntry csentry;
                ReferenceValue DN;
                ManagementAgent = mventry.ConnectedMAs["ImportTest"];
                Connectors = ManagementAgent.Connectors.Count;
                if (0 == Connectors)
                    csentry = ManagementAgent.Connectors.StartNewConnector("Person");
                    csentry["anchor-attribute"].Value = mventry["employeeID"].Value;
                    csentry["objectclass"].Value = "Person";
                    csentry["delta"].Value = "Add";
                if (1 == Connectors)
                ManagementAgent = mventry.ConnectedMAs["AD"];
                Connectors = ManagementAgent.Connectors.Count;
                if (0 == Connectors)
                    DN = ManagementAgent.EscapeDNComponent("CN=" + mventry["accountName"].Value).Concat("OU=ECMA2,DC=corp,DC=contoso,DC=com");
                    csentry = ManagementAgent.Connectors.StartNewConnector("user");
                    csentry.DN = DN;
                    csentry["samAccountName"].Value = mventry["accountName"].Value;
                if (1 == Connectors)
  11. At the top, select Build and choose Build Solution from the drop-down. At the bottom, in the Output window you should see Build: 1 succeeded.

Enable Provisioning

In order to begin provisioning with the Synchronization Service, provisioning must be enabled. Use the steps below to enable provisioning.

To create the new File-based Management Agent

  1. Back in the Synchronization Service, the options screen should still be up.

  2. In the box next to Rule extension name:, click Browse. This will bring up the select File dialog.

  3. Select MVExtension.dll and click OK.

  4. Back on the options screen, place a check in Enable Provisioning Rules Extension.

    MV Rules 3