Solved

Sort computers by last logon in AD?

Posted on 2006-11-10
1
306 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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now