Solved

Sort computers by last logon in AD?

Posted on 2006-11-10
1
309 Views
Last Modified: 2009-07-14
Is there any way to filter computers by last logon?  I see an option similar to that for users, but that doesn't help.

I need to delete all the computers from active directory that are not current, without hand counting.  For example, if a computer has not logged into the domain for over two weeks, it should get purged.
0
Comment
Question by:menreeq
[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
1 Comment
 
LVL 51

Accepted Solution

by:
Netman66 earned 500 total points
ID: 17919409
Two weeks is a little short - what happens with laptop users that are on the road?

If your domain is in Native mode, then this will tell you what computers are "stale" (haven't logged in in 4 weeks).

dsquery computer -inactive 4

To disable them at the same time:

dsquery computer -inactive 4 | dsmod computer -disabled yes



To move them after disabling them:

dsquery computer -inactive 4 | dsmod computer -disabled yes
dsquery computer -disabled | dsmove -newparent "OU=stale,DC=domain,DC=com"



0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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