Solved

Sort computers by last logon in AD?

Posted on 2006-11-10
1
307 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Instant VM Recovery 4 93
Windows 2003 new patches 11 71
How can I save DHCP Scopes and Reservations in PowerShell? 18 82
Shadow copies windows server 2003 2 86
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
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…

785 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