Lotus Notes with LDAP Connection

Objective :- Connect to lotus domino server with authorized credentials and after wards creation, updation & deletion of Users & Groups using LDAP.

Technology used :- C# via Code.

Here i am not using notes client to get connected and create users accordingly.

I am able to create users via LDAP Connection object of .NET Framework. Below is the code for it.

DirectoryAttribute Da;

        string dn = String.Format("CN={0},O={1}", user, organization);





        // create a request to add the new object

        AddRequest AddRequest = new AddRequest(dn);



        Da = new DirectoryAttribute("sn");

        Da.Add(user);

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("cn");

        Da.Add(user);

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("userpassword");

        Da.Add(password);

        AddRequest.Attributes.Add(Da);



        //Add The Email Path

        Da = new DirectoryAttribute("mailfile");

        Da.Add(@"mail/" + user);

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("mailserver");

        Da.Add("GVV/HCL");

        AddRequest.Attributes.Add(Da);





        // Add the objectClass attribute

        Da = new DirectoryAttribute("objectclass");



        Da.Add("dominoPerson");

        Da.Add("inetOrgPerson");

        Da.Add("organizationalPerson");

        Da.Add("person");



        AddRequest.Attributes.Add(Da);

        

        // Send the request through the connection

        m_Ldap.SendRequest(AddRequest);

Problem no 1:- I am not able to create user Email file folder and .ID file, for which I need to register the user that I dont know how to register a user via LDAP connection.

Problem no 2:- I am not able to create groups using this LDAP connection as a error comes up mentioning “An object class voilation occurs”. Here is the code for creating groups.

DirectoryAttribute Da;

        string dn = String.Format("CN={0},O={1}", user, organization);





        // create a request to add the new object

        AddRequest AddRequest = new AddRequest(dn);



        Da = new DirectoryAttribute("Group name");

        Da.Add("Test Group");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Group type");

        Da.Add("Servers only ");

        AddRequest.Attributes.Add(Da);



       



        //Add The Email Path

        Da = new DirectoryAttribute("Internet address");

        Da.Add("WWW.GOOGLE.COM");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Mail Domain");

        Da.Add("GVV/HCL");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Auto-Populate Method");

        Da.Add("GVV/HCL");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Home Server(s)");

        Da.Add("GVV/HCL");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Additional Members");

        Da.Add("GVV/HCL");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Excluded Members");

        Da.Add("GVV/HCL");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Members");

        Da.Add("GVV/HCL");

        AddRequest.Attributes.Add(Da);





        Da = new DirectoryAttribute("Owners");

        Da.Add("Abhishek Rai/HCL");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Administrators");

        Da.Add("Abhishek Rai/HCL");

        AddRequest.Attributes.Add(Da);



        Da = new DirectoryAttribute("Allow foreign directory synchronization");

        Da.Add("Yes");

        AddRequest.Attributes.Add(Da);





        Da.Add("groupOfNames");



        AddRequest.Attributes.Add(Da);



        // Send the request through the connection

        m_Ldap.SendRequest(AddRequest);

Please guide me in the right direction as i need Help on this.