Help and Support
 

powered byLive Search

How To Find Password Last Changed Date Using ADSI

Retired KB ArticleThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Article ID:192949
Last Review:September 28, 2007
Revision:2.4
This article was previously published under Q192949

SUMMARY

The Active Directory Service Interfaces (ADSI) Windows NT provider does not support the PasswordLastChanged Property of an IADsUser object. You can computer this date by subtracting the password expiration period from the password expiration date to get the last change date. Note that for users whose passwords never expire, the PasswordExpirationDate will be in the past and the computation still works correctly.

Back to the top

MORE INFORMATION

The following Visual Basic code illustrates this:
Set adsUser = GetObject("WinNT://" & strDomain & "/" & strUser & _
       ",user")

   Debug.Print "Password Last Changed on : " & CStr( _
       DateAdd("s", -adsUser.Get("MaxPasswordAge"), _
           adsUser.PasswordExpirationDate))
				

Back to the top

REFERENCES

Active Directory Service Interfaces (ADSI) documentation is available in the Platform SDK section of MSDN and in a help file you can download from the following Web site:
http://msdn2.microsoft.com/library/aa772170.aspx (http://msdn2.microsoft.com/library/aa772170.aspx)

Back to the top


APPLIES TO
Microsoft Windows 95
Microsoft Windows NT Server 3.51
Microsoft Active Directory Service Interfaces 2.5

Back to the top

Keywords: 
kbapi kbhowto kbnetwork KB192949

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.