You can try this code snippet (from
IADsUser Property Methods[^]):
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;
}
And add:
DATE date;
hr = pUser->get_PasswordExpirationDate(&date);
printf("Date: %f\n", date);
Finally, tell us if this attempt succeeded.