I have been trying (in C# 2.0) using several ways to add an LDAP Member object to a group.
Below you can see the code and two of the ways I tried:
Expand|Select|Wrap|Line Numbers
- DirectoryEntry newEntry;
- //.....
- // Creating the LDAP member entry.....no problems here!!!
- //....
- using (DirectoryEntry groupEntry = GetGroupEntry())
- {
- groupEntry.Properties["member"].Add(newEntry.Path);
- groupEntry.CommitChanges(); <-- Exception here
- }
- COMException: ex = {"The attribute type specified to the directory service is not defined. (Exception from HRESULT: 0x8007200C)"}
groupEntry.Invoke("Add", new object[] { newEntry.Path });
In this case I get:
"Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))"
right after the Invoke method!
Any help or comment is most appricated!