Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Removing old AD computers

Posted on 2011-03-08
3
Medium Priority
?
280 Views
Last Modified: 2012-05-11
I have a lot of old machines on our AD that I need to clean it up. How to I do so .
 
0
Comment
Question by:koscisze
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Seth Simmons earned 2000 total points
ID: 35072345
From a domain controller...

dsquery computer -inactive x

replace x with number of weeks since being inactive

dsquery computer -inactive 52

displays computer accounts inactive more than 1 year

if you want to automatically remove those accounts...

dsquery computer -inactive 52 | dsrm
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 35072408
I like using oldcmd from joeware.net it can also give you a nice report before you want to delete any computers.

http://www.joeware.net/freetools/tools/oldcmp/usage.htm
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 35072413
"oldcmd" should be oldcmp
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question