VBS: Get old computer accounts from AD

UPDATED 2011-02-10: Added support for 33000+ records. Thanks to Mike for finding the limitation and testing the solution. (Note for 33000 records script takes about 1.5hrs to run)

The VBScript loops through the AD and lists all of the computer accounts in a csv file.

The Excel Code does the same except places the data in a formated table in excel, note it is only tested with excel 2007.

The following properties are returned:

  • Hostname,
  • Password Last Set,
  • Day Count (since password was last set),
  • Recent (was this done within the days specified in the script),
  • Disabled?,
  • Top Level OU,
  • OU,
  • Distinguished Name

Read More