Check login credentials for a computer user

I would like to check the login credentials for any user, to see if it's still the same password or if it has changed,.
A script would be beneficial or a program.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wesley MillerComputer Network AnalystCommented:
Is this for a Local Account , Active Directory  , or Azure Account ?
100questionsAuthor Commented:
This is for Active Directory, on a Windows Server 2016
Michael B. SmithManaging ConsultantCommented:
This tells you when a password was last set for a given user:

$date = [DateTime]( get-aduser michael.smith -prop pwdLastSet ).pwdLastSet
$date = $date.AddYears( 1600 ).ToLocalTime()

Open in new window

Get a highly available system for cyber protection

The Acronis SDI Appliance is a new plug-n-play solution with pre-configured Acronis Software-Defined Infrastructure software that gives service providers and enterprises ready access to a fault-tolerant system, which combines universal storage and high-performance virtualization.

100questionsAuthor Commented:
Thanks Michael, is this a script?  If yes, what type is it?
Michael B. SmithManaging ConsultantCommented:
Yes. That's PowerShell using the ActiveDirectory module.
Shaun VermaakTechnical SpecialistCommented:
Use DSInternals to pull the user hash and compare it against the previously found hash. pwdLastSet will not be accurate if someone bypasses security and use the same password
100questionsAuthor Commented:
Michael, the Powershell script does not work for me, however thank you.
100questionsAuthor Commented:
@Echo Off

set INPUT1=
set INPUT2=
set INPUT3=
set /P INPUT1=Domain: %=%
set /P INPUT2=Username: %=%
C:\Windows\System32\runas.exe /noprofile /user:%INPUT1%\%INPUT2% "notepad"

The above script works and if successful will open notepad

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaun VermaakTechnical SpecialistCommented:
Ah, now I get what you want. Save this as CheckCredentials.vbs

Option Explicit


On Error Resume Next

Dim strDomain
Dim strUserName
Dim strPassword
Dim objIADS

strDomain = Wscript.Arguments.Named("Domain")
strUserName = Wscript.Arguments.Named("UserName")
strPassword = Wscript.Arguments.Named("Password")

Set objIADS = GetObject("WinNT:").OpenDSObject("WinNT://" & strDomain, strUsername, strPassword, ADS_SECURE_AUTHENTICATION)

If Err.Number = 0 Then
    WScript.Echo strUserName & vbTab & "Good password"
   'Bad password
End If

Open in new window

The run this
CheckCredentials.vbs /Domain:YourDomain /UserName:JSmith /Password:Password1

Open in new window

You can build a list in Excel where usernames are in A1 and then this in B1
="CheckCredentials.vbs /Domain:YourDomain /UserName:" & A1 & " /Password:Password1"

Open in new window

Then copy all B column values and run
100questionsAuthor Commented:
I thought this worked but it does not.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2016

From novice to tech pro — start learning today.