Tuesday, February 5, 2008

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


Garry MSCST said...

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 101

I really want to try your script which seems to be very usefull! Please let me know when this is downloadable. Have a nice Holiday!

Anonymous said...
This comment has been removed by a blog administrator.
AndyZ said...

Fixed the download link.

Jhon Drake said...

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 ( http://www.lepide.com/active-directory-cleaner/) 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.