Creating a Connected Data Source Extension in Visual Basic .NET
This topic describes how to create a connected data source extension for the extensible management agent using Visual Basic .NET and Visual Studio 2005. To create a password extension project, you will need to copy the Microsoft.MetadirectoryServices assembly to your development system and manually create a reference to the assembly. You can find the assembly in the bin\assemblies folder of the Microsoft Identity Integration Server program folder. The default folder for Microsoft Identity Integration Server is C:\Program Files\Microsoft Identity Integration Server\bin\assemblies\.
To create a connected data source extension, you must complete the following steps
- Create a new Visual Basic class library project.
- Add a reference to the Microsoft.MetadirectoryServices assembly.
- Implement the interfaces.
- Build the class library.
- Install the connected data source extension in the extensions folder (optional)
To create a new Visual Basic .NET class library project using Visual Studio 2005
Click Start, point to All Programs, and then click Microsoft Visual Studio 2005.
The Visual Studio 2005 development environment appears.
On the File menu, point to New, and then click Project.
In the New Project dialog box, in Project Types, click Visual Basic.
On the Template menu, click Class Library.
In the Name box, type the name of your rules extension, and then click Browse.
Browse to the location where you want to store the project files, click Open, and then click OK.
Your project name now appears in Solution Explorer.
Note We recommend that you store the project on your local computer rather than at a network location.
To add a reference to the Microsoft.MetadirectoryServices assembly
On the Project menu in Visual Studio 2005, click Add Reference.
In the .NET tab of the Add Reference dialog box, click Microsoft.MetadirectoryServices, and then click OK. If the file does not appear in the Component Name list, click the Browse tab. Browse to the folder with the assembly file, click Microsoft.MetadirectoryServices.dll, and then click Open.
Click OK to close the Add Reference dialog box.
In Solution Explorer, Microsoft.MetadirectoryServices now appears as one of the references.
You will need to implement an import and export interface in your extension. You can implement the IMAExtensibleFileImport interface as your import interface. For the export interface, implement either the IMAExtensibleCallExport interface for a call-based data source or the IMAExtensibleFileExport interface for a file-based data source.
To implement the interfaces
Change Class1 to the name of your class.
Type "Implements Microsoft.MetadirectoryServices.IMAExtensibleFileImport" to implement the IMAExtensibleFileImport interface. When you press Enter, the following code appears:
Public Sub GenerateImportFile(ByVal fileName As String, ByVal connectTo As String, ByVal user As String, ByVal password As String, ByVal configParameters As Microsoft.MetadirectoryServices.ConfigParameterCollection, ByVal fFullImport As Boolean, ByVal types As Microsoft.MetadirectoryServices.TypeDescriptionCollection, ByRef customData As String) Implements Microsoft.MetadirectoryServices.IMAExtensibleFileImport.GenerateImportFile End Sub
In the line following the first Implements statement, type "Implements Microsoft.MetadirectoryServices.IMAExtensibleCallExport" to implement the IMAExtensibleCallExport interface to export data to a call-based data source or "Implements Microsoft.MetadirectoryServices.IMAExtensibleFileExport" to implement the IMAExtensibleFileExport interface.
If you are implementing the IMAExtensibleCallExport interface, the following code appears:
Public Sub BeginExport(ByVal connectTo As String, ByVal user As String, ByVal password As String, ByVal configParameters As Microsoft.MetadirectoryServices.ConfigParameterCollection) Implements Microsoft.MetadirectoryServices.IMAExtensibleCallExport.BeginExport End Sub Public Sub EndExport() Implements Microsoft.MetadirectoryServices.IMAExtensibleCallExport.EndExport End Sub Public Sub ExportEntry(ByVal modificationType As Microsoft.MetadirectoryServices.ModificationType, ByVal changedAttributes() As String, ByVal csentry As Microsoft.MetadirectoryServices.CSEntry) Implements Microsoft.MetadirectoryServices.IMAExtensibleCallExport.ExportEntry End Sub
If you are implementing the IMAExtensibleCallExport interface to export data to a call-based data source, then change the code as appropriate.
To build the class library
On the Build menu, click Build Solution.
If you see the following message, the extension was successfully built:
------ Build started: Project: Connected Data Source Extension, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... Building satellite assemblies... ---------------------- Done ---------------------- Build: 1 succeeded, 0 failed, 0 skipped
The connected data source extension file, which has a .dll extension, is in the bin\Debug folder of your project folder.
Before using the extension, install the file in the extensions folder. The default folder for extensions is C:\Program Files\Microsoft Identity Integration Server\Extensions.
This procedure is optional. You can set Visual Studio 2005 to install the connected data source extension automatically in the extensions folder as part of the build process.
To install the connected data source extension in the extensions folder
In Solution Explorer, click your class library project.
On the View menu, click Property Pages.
There are two folders in the Property Pages dialog box: Common Properties and Configuration Properties.
Open the Configuration Properties folder. In the Configuration drop-down list box, click All Configurations.
In the left pane of the Property Pages dialog box, click Build.
In Output Path, type the name of the rules extensions folder or browse to the location of the rules extensions folder.
The default folder for rules extensions is C:\Program Files\Microsoft Identity Integration Server\Extensions.
See Also
Example: Connected Data Source Extension for Call-Based Data Sources
Example: Connected Data Source Extension for File-Based Data Sources
Send comments about this topic to Microsoft
Build date: 2/16/2009