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 last published in August 2004

Dig Deeper on Microsoft Active Directory Design and Administration

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close