In our environment our user account group creates accounts using Novell eDirectory.We currently sync from eDirectory to our domain, but not the other way.We sometimes run into an issue when a user changes their password using their machine instead of a link provided that changes it in eDirectory. This causes issues with other shared sites were passwords are not synced up.

I've seen tools that will do this, but were not supported in Win 7 x64. To assist in troubleshooting I created a powershell script that will prompt for user ID, and it will return when the password was last changed on our domain. This was created from a variety of different Google searches with a few modifications to meet our needs. I thought I would share just in case anyone else has a similar wacky environment.

$user = read-host "Enter User ID"
$searcher=New-Object DirectoryServices.DirectorySearcher
$searcher.Filter="(&(samaccountname=$user))"
$results=$searcher.findone()
$changedtime = [datetime]::fromfiletime($results.properties.pwdlastset[0])
$c = "The user, $user has changed password last time at $changedtime"
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.MessageBox]::Show($c)

 

 

After prompted for User ID this script will return a time stamp of when that password was last changed.