Solved

Check age of network passwords

Posted on 2004-09-23
1
403 Views
Last Modified: 2012-05-05
I'm admin of a 2003 server and would like to get a list of users and the age of their passwords (but not the passwords themselves). Is there a query i can run to obtain this information? How many different ways can you find out the age of a password? What about finding out when the password will expire? This information is obviously stored since the server knows when to notify people that their password is expiring. Thanks!
0
Comment
Question by:carrp
1 Comment
 
LVL 83

Accepted Solution

by:
oBdA earned 250 total points
ID: 12156221
The command
net user <Username> /domain
in a command window will give you the necessary information.
Here's a small script (it's not fast, but it should work) that creates a comma-separated list of the user names, when the password was last set, and when it expires. Simply adjust the domain information and the log file definition at the beginning.

====8<----[UserPwd.cmd]----
@echo off
setlocal
set LogFile=C:\Temp\UserPwd.log
set DNRoot=dc=your,dc=domain,dc=local

>"%LogFile%" echo Username, Password last set, Password expires
for /f "skip=1" %%a in ('dsquery user "%DNRoot%" ^| dsget user -samid') do call :process %%a
goto leave

:process
set User=%1
if /i "%User%"=="dsget" goto :eof
:: *** Localization: the first number in the "tokens=" must be set to the number of words
:: *** before the dates in the "password last set" and "password expires" lines.
for /f "tokens=3*" %%a in ('net user %User% /domain ^| find /i "Password last set"') do set PwdLastSet=%%b
for /f "tokens=2*" %%a in ('net user %User% /domain ^| find /i "Password expires"') do set PwdExpires=%%b
echo %User%: %PwdLastSet%, %PwdExpires%
>>"%LogFile%" echo %User%,%PwdLastSet%,%PwdExpires%
goto :eof

:leave
====8<----[UserPwd.cmd]----
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
Learn about cloud computing and its benefits for small business owners.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

939 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

9 Experts available now in Live!

Get 1:1 Help Now