Rules Extensions - Creating an MA Extension

In this series of Post we will review and discuss the basic fundamentals of Rules Extensions, how to get started and how to develop , build, and deploy extensions. Please note that all Blog Postings, discussions and code within the Connector Space blog is to referenced at your own risk, every effort has been made to provide the most accurate information but at times types and other mistakes are made when writing these blog post so be sure to test all information especially code in your development environments prior to using within your production environment.

This post will focus on the Creation of the initial MA Extension; additional post will focus on the individual sections of the extension.

Additionally, I am writing this 1 MA Extension to be used across all my Management Agents of like types in my Environment, instead of writing individual extensions for each MA.

Additional links for understanding Management Agent rules extensions
Management Agent Rules Extensions

Considerations:

1.) How many “MA’s” (Management Agents) will be referencing this extension?

2.) Are there different types of Management Agents that need a custom extension written?

3.) Will this extension be used for all of your attribute flows or will you also be using Sync Rules created in the FIM / MIM Portal?

4.) How many total custom attribute flows will be needed?

From My Experience:

So I usually create 1 MA Extension to use for all like type MA’s, for example if I had 3 Active Directory Domain Services Management Agents and 2 SQL Server Management Agents I would create 1 Extension for the Active Directory Domain Services Management Agents and another for the SQL Management Agents.

Getting Started:

Open up the Synchronization Service

clip_image002

Click on the Management Agents Tab at the top

clip_image004

Click on the Management Agent you wish to create an extension for, in my example I will be creating 1 extension to be used for both Contoso ADMA and Fabrikam ADMA but I only select 1 of the MA’s.

clip_image006

Right click on the MA and select Create Extension Projects… followed by Rules Extension

clip_image008

A Create Extension Project (pop up window) will appear,

For programming language: Select “Visual C#”

Visual Studio Version: Select your version of Visual Studios you will be developing your code in.

Project name: If you’re only creating 1 extension be used (referenced) by all your MA’s you could use the default Name of “MAExtension” but if you have multiple Sync Solutions you may want to be more specific in the naming convention to avoid confusion.

Project location: By default, the local Documents folder will be pre populated but this can be changed to any desired location.

clip_image010

After you carefully selected all of your options and named your project, if Visual Studios is local to the Server you are on then leave the Launch in VS.Net IDE selected and click on Ok

After a few seconds your new Project should load into Visual Studios, (if the Launch in VS.Net IDE was selected.), if you chose not to launch Visual Studios or Visual Studios is not local to your server you will just need to Open up Visual Studios manually and import the project from its location.

clip_image012

Click on the .cs file

clip_image014

Your now ready to start developing your MA Extension.

Let’s take a look at the initial Code

using System;

using Microsoft.MetadirectoryServices;

namespace Mms_ManagementAgent_CrossForestADMAExtension

{

/// <summary>

/// Summary description for MAExtensionObject.

/// </summary>

public class MAExtensionObject : IMASynchronization

{

public MAExtensionObject()

{

//

// TODO: Add constructor logic here

//

}

void IMASynchronization.Initialize ()

{

//

// TODO: write initialization code

//

}

void IMASynchronization.Terminate ()

{

//

// TODO: write termination code

//

}

bool IMASynchronization.ShouldProjectToMV (CSEntry csentry, out string MVObjectType)

{

//

// TODO: Remove this throw statement if you implement this method

//

throw new EntryPointNotImplementedException();

}

DeprovisionAction IMASynchronization.Deprovision (CSEntry csentry)

{

//

// TODO: Remove this throw statement if you implement this method

//

throw new EntryPointNotImplementedException();

}

bool IMASynchronization.FilterForDisconnection (CSEntry csentry)

{

//

// TODO: write connector filter code

//

throw new EntryPointNotImplementedException();

}

void IMASynchronization.MapAttributesForJoin (string FlowRuleName, CSEntry csentry, ref ValueCollection values)

{

//

// TODO: write join mapping code

//

throw new EntryPointNotImplementedException();

}

bool IMASynchronization.ResolveJoinSearch (string joinCriteriaName, CSEntry csentry, MVEntry[] rgmventry, out int imventry, ref string MVObjectType)

{

//

// TODO: write join resolution code

//

throw new EntryPointNotImplementedException();

}

void IMASynchronization.MapAttributesForImport( string FlowRuleName, CSEntry csentry, MVEntry mventry)

{

//

// TODO: write your import attribute flow code

//

throw new EntryPointNotImplementedException();

}

void IMASynchronization.MapAttributesForExport (string FlowRuleName, MVEntry mventry, CSEntry csentry)

{

//

// TODO: write your export attribute flow code

//

throw new EntryPointNotImplementedException();

}

}

}

To continue with your MA Extension please visit the following post.

IMASynchronization.ShouldProjectToMV IMASynchronization.MapAttributesForJoin IMASynchronization.MapAttributesForImport

IMASynchronization.MapAttributesForExport

 

Questions? Comments? Love FIM/MIM so much you can’t even stand it?

EMAIL US!

>WE WANT TO HEAR FROM YOU<

## https://blogs.msdn.microsoft.com/connector_space# #

Comments

  • Anonymous
    August 26, 2016
    Hello!As I understand following post is in progress?Thanks!