Get inactive computers in domain using command line

By |2017-12-07T11:13:40+00:00August 15th, 2012|Azure, Cloud, Windows|0 Comments

Here is a quick command that can be run on the domain to see if there are are computer accounts in Active Directory that have been inactive for over a month:

dsquery computer "OU=OU NAME,DC=DOMAIN,DC=LOCAL" -inactive 4 -limit 0  

The inactive value increases by weeks so two months would be 8 and so on.

You can narrow down the OU by simply putting in the distinguished name of the OU in the “”

Cheers

Paul

Leave A Comment

like what you see? 

Sign-up to our newsletter and never miss out on the latest blogs, events and tech news from the world of risual
SUBSCRIBE!
Give it a try, you can unsubscribe anytime.