Click here to Skip to main content
15,898,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

i read the display name , and other things from the ad using c++. (AD 2003)
But i don't know how to get the password expired date for the specific user..
can you help me ..
Posted
Updated 27-Apr-12 5:00am
v2

1 solution

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.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900