«

»

May 01

How to tell the last PC connect date with Active Directory

 As machines get added and removed from Active Directory domains, you eventually end up with a bunch of records for machines that no longer exist. In order to make sure that the dead AD entries for PC’s and Servers that you are about to delete are actually dead (or at least very, very close to dead), you can run the following command at the command prompt:

dsquery computer -name * -stalepwd 120 -d {domain name}

Adjust the 120 (days) as needed. 45 days should be plenty of days since the last time a machine checked in with the domain. You can pipe this command out to a text file for later review. 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

%d bloggers like this: