Search Active Directory for stale computer accounts and disable them. (Powershell)

** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK **

Scans an OU and any child OUs for computer accounts that have not logged in for 30 days. It disables those computer accounts, moves them to the disabledOU and sets the description of each object to whatever you like. It also writes a logfile to the $logpath.

 

Leave a Reply