List Expired User Accounts for an Active Directory Container

This script enumerates and records in a text file all the expired accounts found in the User container.

 
 
 
 
 
5 Star
(1)
Add to favorites
Active Directory
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
  • How to get the correct date value
    2 Posts | Last post September 05, 2011
    • Hello,
      I've use this script and it's works fine but the expiration date in the text file is not equal like the expiration date in the user account settings dialog.
      For example: User 1 has the expiration at jan 31 2010 and the text file listing it at feb 01 2010.
      What ever it will differ one day.
      
    • When ADUC shows an expiration date, it means at the end of that day. This really means any time during the next day. For example, if ADUC shows the expiration date as "End of: Saturday April 21, 2007", this really means April 21, 2007 24:00, which is the same as April 22, 2007 00:00. An actual expiration date of April 22, 2007 10:15 AM will also show as "End of: April 21, 2007" in ADUC. In fact, an expiration date of April 22, 2007 23:59:59 still shows as "End of: April 21, 2007" in ADUC.