Demonpiggies
Programmer
As stated in the subject, I need to find the expiration date or time of a user's password using NTLM. I have to access Active Directory using NTLM because the rest of the code uses that "standard." One of my team members is trying to use LDAP but we're not really supposed to use that sooo....
anyway I'm using SECPKG_ATTR_PASSWORD_EXPIRY which returns (after formatting) Friday Dec. 30, 1899. Granted MY password will not expire but we tried it on a personal server with a password and login that will expire tommorrow and it still returns Dec 1899.
Does anyone know of NTLM's ways or another way to return the expiration date?
ASSUME: GetExpirationDays() works (because it does) it returns the number of days from today that teh password will expire.
PLEASE help if you can we've been on this and nothing else for 4 days now and have almosts nothing.....
anyway I'm using SECPKG_ATTR_PASSWORD_EXPIRY which returns (after formatting) Friday Dec. 30, 1899. Granted MY password will not expire but we tried it on a personal server with a password and login that will expire tommorrow and it still returns Dec 1899.
Code:
//Get experation date of password if applicable
FILETIME tsExpirationDate;
SYSTEMTIME stReadableExpirationDate;
//Retrieve password expiration date.hContext
ss = g_pFuncs->QueryContextAttributes( &asClient.hContext, SECPKG_ATTR_PASSWORD_EXPIRY, (PVOID)(&tsExpirationDate) );
if( ss == SEC_E_OK )
{
//Convert FILETIME to SYSTEMTIME
FileTimeToSystemTime( &tsExpirationDate, &stReadableExpirationDate );
//And set the expiration members
SetExpirationDate( stReadableExpirationDate );
}
CString blah;
int days = GetExpirationDays();
CString bleh;
bleh = "hahah: %d ";
blah.Format( bleh, days);
AfxMessageBox( blah, MB_OK | MB_ICONSTOP | MB_APPLMODAL );
ASSUME: GetExpirationDays() works (because it does) it returns the number of days from today that teh password will expire.
PLEASE help if you can we've been on this and nothing else for 4 days now and have almosts nothing.....