How do most admins keep track of active computers in active directory

joukiejouk used Ask the Experts™
There has been a number of computers that are inactive.  We never had any sort of master list to keep track of active or inactive computers. Now we must do some housecleaning in our active directory and remove computers that no longer exists. What do most admins do or what is there approach for house cleaning the AD  environment? how would I know what machines are inactive so I can remove them from active directory
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
It varies from environment to environment. Smaller environments can do with a spreadsheet.  Larger environments likely have some kind of CMDB (configuration management database).

You need to decide on what should be the authoritative list, and then set up a process to periodically true-up active directory to the authoritative list.
At my old company we wrote a Powershell script to pull which AD Computers were inactive or have not been logged into for more than 90 days.

If a machine was inactive for more than 90 days we put it into a "disabled computer" OU, disabled the machines then if no one reached out to say they could not login within a week we deleted the computers.
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013
You could just run (from a DC) DSQUERY Computer -inactive 13 to get a list of all computers that have been inactive for the last 13 weeks and delete them.  (Once deleted, if there was a mistake, you can just add them back).  Though you might take intermediate measures like putting them in an OU with a group policy attached that pops up a notice to the end user that the machine will be removed unless the end user reports to IT that it's still active.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

E ATech Lead
You may get help from this blog to keep track of inactive computers and ways to regularly clean up inactive users & computers in your Active Directory.


I will look into these options.


Hello Lee W,

I am using your method and have ran DSQUERY Computer -inactive 13 to identify inactive computers. I see the results. Is there a way to export the results to Excel?
FYI, that will also display disabled computer accounts.

IMO, a better way is to use powershell:


Never use Powershell before, and need some help. I've placed the powershell script in the following directory of an AD server in which i plan to execute it on.
I bring up PS and ran the command but got the following error below.
Can someone please tell me the proper command?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial