Q

Checking inactive accounts with Active Directory

How can I check what users have not logged into their accounts > 60 days using Active Directory and Windows 2000?
There are several ways to perform this. A simple way to perform this would be to run the NET USER command on any user that you would like to know. You could also use ADSI scripting to produce the output a little cleaner. . Output a list of the names by exporting them from AD. Then you can use a simply FOR statement to reset the accounts. Let's say your text file is names.txt. Create a batch file called CheckUser.bat. Put in the batch file the following:
FOR /F %%I in (names.txt) do SHOWUSER

:SHOWUSER
Echo %%I 
NET USER %%I /DOMAIN | FIND "Last logon"
This was first published in August 2004

Dig deeper on Microsoft Active Directory Design and Administration

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close