I found some documentation that looks like I need to use the IADsUser interface to get access to these properties. I'm not sure if using the IADsUser interface means that I need to use a different method to create my object. I found the following C++ sample.
IADsUser *GetUserObject(LPWSTR uPath)
{
IADsUser *pUser;
HRESULT hr = ADsGetObject(uPath,IID_IADsUser,(void**)&pUser);
if (FAILED(hr)) {return NULL;}
BSTR bstr;
hr = pUser->get_FullName(&bstr);
printf("User: %S\n", bstr);
SysFreeString(bstr);
return pUser;
}
Can someone tell me how I would do this in VFP? I have tried referring to the properties directly and always get errors. I even tried calling the "get" methods in the format that the C++ code does it, and I get errors.
>>> I need to be able to retrieve and set properties like Employee-ID, etc.
>>
>>Maybe you're thinking too hard about it. :-)
>>
oGroup=GETOBJECT('WinNT://REDMOND/Administrators')
>>oGroup.add('WinNT://Redmond/mikestew')
>>Release oGroup
>>oUser=GETOBJECT("WinNT://REDMOND/mikestew")
>>oUser.employeeid='1234'
>
>
>That doesn't work for me. I changed the domain and user name in your example and I can create the object, but when I try to display the oUser.employeeid property I get "Active Directory property cannot be found in the cache".