Creating a Password Extension in Visual Basic .NET

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

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 Microsoft Identity Integration Server (MIIS) program folder. The default folder for MIIS is C:\Program Files\Microsoft Identity Integration Server\bin\assemblies\.

To create a password extension using Visual Studio 2005, 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)

ms695381.wedge(en-us,VS.85).gifTo create a new Visual Basic .NET class library project using Visual Studio 2005

  1. Click Start, point to All Programs, and then click Microsoft Visual Studio 2005.

    The Visual Studio 2005 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.

  4. On the Template menu, click Class Library.

  5. In the Name box, type the name of your rules extension, and then click Browse.

  6. 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.

ms695381.wedge(en-us,VS.85).gifTo add a reference to the Microsoft.MetadirectoryServices assembly

  1. On the Project menu in Visual Studio 2005, click Add Reference.

  2. 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.

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

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

ms695381.wedge(en-us,VS.85).gifTo 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
    

ms695381.wedge(en-us,VS.85).gifTo build the class library

  • On the Build menu, click Build Solution.

    If you see the following message, the password extension was successfully built:

    ------ Build started: Project: Password Extension, Configuration: Debug .NET ------
    
    Preparing resources...
    Updating references...
    Performing main compilation...
    Building satellite assemblies...
    
    
    
    ---------------------- Done ----------------------
    
        Build: 1 succeeded, 0 failed, 0 skipped
    

    The password extension file, which has a .dll extension, is in the bin\Debug folder of your project folder.

    Before using the password extension, install the file in the extensions folder. The default extensions folder is C:\Program Files\Microsoft Identity Integration Server\Extensions.

This procedure is optional. You can set Visual Studio 2005 to install the password extension automatically in the extensions folder as part of the build process.

ms695381.wedge(en-us,VS.85).gifTo 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 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: Password Extension

Send comments about this topic to Microsoft

Build date: 2/16/2009