[Date Prev][Date Next] [Chronological] [Thread] [Top]

Add an Entry with ADSI in C++

I'm trying to create an entry of class 'person' in an OpenLDAP directory
using ADSI.
I could not figure out why this is not working since the only required
attribute is 'sn'.
Here is my code :

IADsContainer *pCont = NULL;
IADs *pADs = NULL;
IDispatch *pDisp = NULL;
hr =
eur,dc=rtetest,dc=org", L"rtekb", 0, IID_IADsContainer,(void**)&pCont);
hr = pCont->Create(CComBSTR("person"), CComBSTR("cn=JeffSmith"),
hr = pDisp->QueryInterface(IID_IADs, (void**) &pADs);
hr = pADs->Put(CComBSTR("sn"), CComVariant("JeffSmith"));
hr = pADs->SetInfo(); // Error  0x80072014 the requested operation did
not satisfy one or more contraints associated with the object

Any help appreciated