Commands for deleting old computer accounts from active directory

This command will pipe all the accounts it finds that have not logged in for 10 weeks to file c:users.txt – dsquery computer dc=domain,dc=local -inactive 10 -limit 0 >c:users.txt
 
Same as command above but it just displays it in CMD prompt – dsquery computer dc=domain,dc=local -inactive 10 -limit 0
 
This command will find the computer accounts and also delete them – dsquery computer dc=domain,dc=local -inactive 10 -limit 0 | dsrm
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply