Find and Disable Inactive Computer Objects in Active Directory

I like my Active Directory, or at least the OUs in AD that I manage, to not have stale objects hanging around. Over time computers come and go, but they often leave behind their accounts in your Active Directory. I like to automate things as much as possible, so to go through AD and find inactive computers I wrote a VB Script to find stale computer accounts and disable them for me. As this is a mostly automated process, I wrote the script to update the object description in Active Directory so that it is clear why the computer object is disabled.

View and Download ADInactiveComputers.vbs on GitHub:Gist

4 thoughts on “Find and Disable Inactive Computer Objects in Active Directory

  1. The .VBS file doesnt download, it returns with an error of:Warning: mime_magic: invalid type 0 in mconvert(). in /home/project/web/itouthouse/files/files.php on line 101I really want to try your script which seems to be very usefull! Please let me know when this is downloadable. Have a nice Holiday!


  2. Good information, thanks for sharing useful information related to find and disable inactive computer accounts in active directory environment. I tested this active directory cleaner tool ( to find out the computer accounts who have not logged within x number of days and assists to manage inactive accounts and move them to another OU. This software generates the report basis on inactive or old user and computer, never logged on users and real last log on information of accounts.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s