Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. OpenLDAP and .NET

OpenLDAP and .NET

Scheduled Pinned Locked Moved C#
csharpvisual-studiocomsysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jan Szumiec
    wrote on last edited by
    #1

    I am having a weird problem adding new objects to the directory server. I am logged in using the Manager account, so I have r/w access to everything. Here's how I add an object: DirectoryEntry de = configuration.Bind(); // <- this works fine, I can read everything. DirectoryEntry newEntry = de.Children.Add("cn=John Doe", "inetOrgPerson"); newEntry.Properties["sn"].Value = "Doe"; newEntry.Properties["givenName"].Value = "John"; newEntry.CommitChanges(); // <- this is where the exception is thrown. System.Runtime.InteropServices.COMException (0x80072037): There is a naming violation. at System.DirectoryServices.Interop.IAds.SetInfo() at System.DirectoryServices.DirectoryEntry.CommitChanges() at HMSImport.MainForm.menuItem3_Click(Object sender, EventArgs e) in c:\documents and settings\jd\my documents\visual studio projects\hmsimport\mainform.cs:line 255 Does anyone have a clue as what it could be? I am running openldap-2.2.9 as the directory server.

    O 1 Reply Last reply
    0
    • J Jan Szumiec

      I am having a weird problem adding new objects to the directory server. I am logged in using the Manager account, so I have r/w access to everything. Here's how I add an object: DirectoryEntry de = configuration.Bind(); // <- this works fine, I can read everything. DirectoryEntry newEntry = de.Children.Add("cn=John Doe", "inetOrgPerson"); newEntry.Properties["sn"].Value = "Doe"; newEntry.Properties["givenName"].Value = "John"; newEntry.CommitChanges(); // <- this is where the exception is thrown. System.Runtime.InteropServices.COMException (0x80072037): There is a naming violation. at System.DirectoryServices.Interop.IAds.SetInfo() at System.DirectoryServices.DirectoryEntry.CommitChanges() at HMSImport.MainForm.menuItem3_Click(Object sender, EventArgs e) in c:\documents and settings\jd\my documents\visual studio projects\hmsimport\mainform.cs:line 255 Does anyone have a clue as what it could be? I am running openldap-2.2.9 as the directory server.

      O Offline
      O Offline
      osamahmirza
      wrote on last edited by
      #2

      Hi Jan, I dont think you should do like this: newEntry.Properties["sn"].Value = "Doe"; newEntry.Properties["givenName"].Value = "John"; rather use Add instead of Value this it should work newEntry.Properties["sn"].Add = "Doe"; newEntry.Properties["givenName"].Add = "John"; I hope it helps Osama Mirza

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups