Does Windows provide a command line utility that lets me check a domain user's password? It is sufficient that the utility returns success(0) if I provide a matching domain user name and password. Alternatively, is there a simple VB/JS script that can do this?

I'm the Intranet admin of my company and have the default password set for corporate staff, so I'd like to quickly scan which users have not changed their default password.

Better yet, are there any books or websites which cover such topics so that I can get more information?

  • 1
    Do you have access to a Domain Controller? It would be much more efficient if you query the Active Directory for (i belive it's called) password-age. This is executed and you get the result for all users within a second.
    – Layticia
    Jul 15 '11 at 8:32
  • Yes, I have domain administrator password.
    – Jimm Chen
    Jul 15 '11 at 9:03

As from the question-comments you have access to the Active Directory. Go to Active Directory Management Console and right-click -> Find. Do a "Customer Search" and enter in the "Advanced Tab"


This will give you all Accounts from the whole Directory that never changed their initaial set passwords.i

  • Thanks for you hint, but I think it is not feasible. When I create a new user from Windows 2003 console using Active Directory Users and Computers, Windows lets me assign a default password for the new user. Once that is done, pwdLastSet exists from then on, so, the query with pwdLastSet<=0 will never be matched, right? See this image: i285.photobucket.com/albums/ll80/chjfth/pwdLastSet.png
    – Jimm Chen
    Jul 18 '11 at 0:48
  • I've tested this on Windows 2008 with a newly created account. I'll test this on 2003 as well and report back
    – Layticia
    Jul 18 '11 at 18:43

Benefit from the tip here https://stackoverflow.com/a/4601056 , I managed to use Python to do that.

import win32security
lg = win32security.LogonUser('username', 'domainname', 'password', win32security.LOGON32_LOGON_NETWORK,win32security.LOGON32_PROVIDER_DEFAULT)

If no exception occurs in win32security.LogonUser(), then the password is correct.

enter image description here


  • Python 2.7.
  • pywin32 package
  • the client machine(the one running Python program) has joined to the domain.
  • [to verify]Group policy on the client machine allow arbitrary domain user to logon locally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.