Microsoft Identity Integration Server 2003 Developer Reference

Creating a Password Extension in Visual Basic .NET

This topic describes how to create a password extension using Visual Basic .NET and Visual Studio .NET 2003.

To create a password extension project, 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 MIIS program folder. The default folder for Microsoft Identity Integration Server is C:\Program Files\Microsoft Identity Integration Server\bin\assemblies\.

To create a password extension using Visual Studio .NET, you must complete the following steps:

  1. Create a new Visual Basic class library project
  2. Add a reference to the Microsoft.MetadirectoryServices assembly
  3. Implement the interfaces
  4. Build the class library
  5. Install the password extension in the extensions folder (Optional)

To create a new Visual Basic .NET class library project using Visual Studio .NET 2003

  1. Click Start, point to All Programs, and then click Visual Studio .NET 2003.

    The Microsoft Visual Studio .NET 2003 development environment appears.

  2. On the File menu, point to New, and then click Project.
  3. In the New Project dialog box, in Project Types, click Visual Basic Projects.
  4. On the Template menu, click Class Library.
  5. In the Name box, type the name of your password extension, and then click Browse.
  6. Browse to the location where you want to store the project files, click Open, and then click OK.

    The new project name now appears in Solution Explorer.

To add a reference to the Microsoft.MetadirectoryServices assembly

  1. On the Project menu in Visual Studio .NET 2003, click Add Reference.
  2. In the .NET tab of the Add Reference dialog box, click Microsoft.MetadirectoryServices, and then click Select. If the file does not appear in the Selected Components list, click Browse. In the Selected Components dialog box, go to the folder with the assembly file, click Microsoft.MetadirectoryServices.dll, and then click Open.

    Verify that Microsoft.MetadirectoryServices.dll appears in the Selected Components list of the Add Reference dialog box.

  3. Click OK to close the Add Reference dialog box.

    In Solution Explorer, Microsoft.MetadirectoryServices now appears as one of the references.

To implement the interfaces

  1. Change Class1 to the name of your class.
  2. Following the class declaration, type Implements Microsoft.MetadirectoryServices.IMAPasswordManagement to implement the IMAPasswordManagement interface. When you press Enter, the following code appears:
    Public Sub BeginConnectionToServer(ByVal connectTo As String, ByVal user As String, ByVal password As String) Implements Microsoft.MetadirectoryServices.IMAPasswordManagement.BeginConnectionToServer
    
    End Sub
    
    Public Sub ChangePassword(ByVal csentry As Microsoft.MetadirectoryServices.CSEntry, ByVal OldPassword As String, ByVal NewPassword As String) Implements Microsoft.MetadirectoryServices.IMAPasswordManagement.ChangePassword
    
    End Sub
    
    Public Sub EndConnectionToServer() Implements Microsoft.MetadirectoryServices.IMAPasswordManagement.EndConnectionToServer
    
    End Sub
    
    Public Function GetConnectionSecurityLevel() As Microsoft.MetadirectoryServices.ConnectionSecurityLevel Implements Microsoft.MetadirectoryServices.IMAPasswordManagement.GetConnectionSecurityLevel
    
    
    End Function
    
    Public Sub RequireChangePasswordOnNextLogin(ByVal csentry As Microsoft.MetadirectoryServices.CSEntry, ByVal fRequireChangePasswordOnNextLogin As Boolean) Implements Microsoft.MetadirectoryServices.IMAPasswordManagement.RequireChangePasswordOnNextLogin
    
    End Sub
    
    Public Sub SetPassword(ByVal csentry As Microsoft.MetadirectoryServices.CSEntry, ByVal NewPassword As String) Implements Microsoft.MetadirectoryServices.IMAPasswordManagement.SetPassword
    
    End Sub
    

To build the class library

This procedure is optional. Alternatively, you can set Visual Studio .NET 2003 to install the password extension automatically in the extensions folder as part of the build process.

To install the password extension in the extensions folder

  1. In Solution Explorer, click your class library project.
  2. On the View menu, click Property Pages.

    There are two folders in the Property Pages dialog box: Common Properties and Configuration Properties.

  3. Open the Configuration Properties folder. In the Configuration drop-down list box, click All Configurations.
  4. In the left pane of the Property Pages dialog box, click Build.
  5. In Output Path, type the name of the extensions folder or browse to the location of the extensions folder.

    The default folder for extensions is C:\Program Files\Microsoft Identity Integration Server\Extensions.

  6. Click OK to close the Property Pages dialog box.

See Also

Example: Password Extension