Quantcast
Channel: Forum Microsoft Identity Manager
Viewing all articles
Browse latest Browse all 4767

Password synchronization Extension

$
0
0

I have 2 MAs AD MA and SQL MA

Want to synhronize password from AD to SQL.

SQL has following table

FirstNameLastNameEmployeeType EmploymentStatus EmployeeIDOfficeTelephoneMobilePhone IDAppPassword

PCNS is installed with target specified. password management is enabled under tools->options,for AD ma and SQL MA

I have written a password extension for SQL MA

using System;
using System.IO;
using System.Xml;
using System.Text;
using System.Collections.Specialized;
using Microsoft.MetadirectoryServices;
using System.Data.SqlClient;

namespace Miis_PasswordManagement
{
    public class MAPasswordManagement :
        IMAPasswordManagement
    {
        //
        // Constructor
        //
        public MAPasswordManagement(
            )
        {

        }


        public void BeginConnectionToServer(
            string connectTo,
            string user,
            string password
            )
        {
            try
            {
                string connectionString = null;
                SqlConnection cnn;
                connectionString = "Data Source=win2k8base;Initial Catalog=TelephoneDB;Integrated Security=SSPI";
                cnn = new SqlConnection(connectionString);
                cnn.Open();
            }
            catch (Exception Ex)
            {
                //
                // TODO: Remove this throw statement if you implement this method
                //
                //throw new EntryPointNotImplementedException();
                throw new UnexpectedDataException("Error Begintoconnect" + Ex);
            }
        }

        public void EndConnectionToServer(
            )
        {


            //cnn.close();
            //
            // TODO: Remove this throw statement if you implement this method
            //
            //throw new EntryPointNotImplementedException();
        }

        public ConnectionSecurityLevel GetConnectionSecurityLevel(
          )
        {
         //
            // TODO: Remove this throw statement if you implement this method
            //
           throw new EntryPointNotImplementedException();
        }

        public void SetPassword(
            CSEntry csentry,
            string  NewPassword
            )
        {
            try
            {
                SqlCommand sqlCmd = new SqlCommand();
                string DN = csentry.DN.ToString();

                String SQLString = "UPDATE [TelephoneDB].[dbo].[EmployeesData] SET [AppPassword] = '" + NewPassword + "' WHERE ID = '" + DN + "'";
                sqlCmd.CommandText = SQLString;
                //sqlCmd.connection = sqlconnection;
                sqlCmd.ExecuteNonQuery();
                sqlCmd.Dispose();
            }
            catch (Exception Ex)
            {
                throw new UnexpectedDataException("Error SetPassword" + Ex);
                //

                // TODO: Remove this throw statement if you implement this method
                //
                //throw new EntryPointNotImplementedException();
            }
        }

      public void ChangePassword(
        CSEntry csentry,
      string  OldPassword,
      string  NewPassword
            )
       {
            //
            // TODO: Remove this throw statement if you implement this method
            //
            //throw new EntryPointNotImplementedException();
      }

        public void RequireChangePasswordOnNextLogin(
            CSEntry csentry,
            bool    fRequireChangePasswordOnNextLogin
            )
        {
            throw new EntryPointNotImplementedException();
        }
    }
}

PCNS is getting the password and sending it to SQL. It is able to get the DN for which it needs to set the password

 Event 

A password notification was successfully staged for synchronization. 

Additional information: 
Reference ID: {1A8ED5DB-2A17-4FE9-A28D-43C354461B4B} 
Target Object GUID: {A409AC81-A17F-E411-B681-000C29F9D1D0} 
Target MA Name: Telephone 
Target DN: 2

But then FIM sync fails with following error

A password synchronization set operation has failed in a target connected data source. 
 
Additional information: 
Tracking ID: {C2061DB0-61D1-49EB-92B1-07DA6E747284} 
Reference ID: {1A8ED5DB-2A17-4FE9-A28D-43C354461B4B} 
Target Object GUID: {A409AC81-A17F-E411-B681-000C29F9D1D0} 
Target DN: 2 
Target MA Name: Telephone 
Retry Count: 1 
ErrorCode: 0x80230730 
ErrorString: (The password extension does not implement the entry point.)

Any suggestions


AdiKumar


Viewing all articles
Browse latest Browse all 4767

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>