These are vbscripts I wrote to help clean up our production Windows 2000 Active Directory by identifing user and computer accounts that are no longer being used.
Neither script makes any changes to any account. Instead they both query the domain and build a report of all accounts with the time and date of their most recent login. Both scripts should be run from a command line, as in "cscript adtool-users.vbs". Launching by double-clicking the file will display a Windows popup box (actually a msgbox) for each account, which isn't what you want. The report is output to the console, in comma separated format. I found it most useful to pipe the results into a text file to import and sort in Excel. The command line for this should be something like "cscript adtool-users.vbs > useraccounts.txt"
Downloads:
HTML format - displays in your browser
adtools-users.vbs
astools-computers.vbs
VBS files - Right-click and save as to download
adtools-users.vbs
astools-computers.vbs
These are provided as-is with no warranty. While I have tested these on a production domain, I cannot be sure they will run correctly in your domain. I suggest looking over the code to verify for yourself what the scripts are doing, and running them in a test domain prior to using them in a production environment.