Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

AD Query for last computer login date

Posted on 2010-11-25
4
Medium Priority
?
3,057 Views
Last Modified: 2012-05-10
Hi.

I am looking for a query (dsquery or similar) that will give me the last login date to the domain of a computer on Server 2003.

If possible, I would also like to know the user account.

Cheers
0
Comment
Question by:agbnielsen
  • 3
4 Comments
 
LVL 6

Expert Comment

by:camacho_marco
ID: 34215072
Take a look at this...

http://www.windowsnetworking.com/kbase/WindowsTips/Windows2003/AdminTips/Admin/PruningOldComputerAccountsinAD.html

following command will find all computers in Active Directory that have not been logged into during the past 8 weeks:

dsquery computer -inactive 8 -limit 0

After reviewing this list to make sure these computers no longer exist on your network you can use the following command to find and delete them:

dsquery computer -inactive 8 -limit 0 | dsrm



Cheers
0
 
LVL 6

Accepted Solution

by:
camacho_marco earned 1600 total points
ID: 34215092
You can also download this free tool

http://www.cjwdev.co.uk/Software/ADTidy/Download.html

Cheers
0
 

Author Closing Comment

by:agbnielsen
ID: 34215167
Perfect
0
 
LVL 6

Expert Comment

by:camacho_marco
ID: 34215199
Thanks 4 the points amigo

Cheers
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

782 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