Automatically Set the pwdLastSet Attribute in Active Directory

Is there any tool or script that can be used to touch the pwdLastSet attribute in Active Directory with the current time/date?

I know how to do it manually - but I have 1,600 accounts that need to be touched without actually resetting their passwords.

Any help would be greatly appreciated.
Cedar Crest CollegeAsked:
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.

MaheshArchitectCommented:
what you can do, download tool like bulk ad users from wisesoft and add those all users as list thereand right click list and click on bulk update

There go to account tab and click "user must change password at next logon" and apply the changes

again select all users in list and from account tab undone changes done above, it will set password last set date to current date for all users

basically toggle Pwdlastset value to 0 first and -1 again

or you can use script

$allusers = Get-ADUser -Filter * -Properties PwdLastSet

foreach ($user in $allusers) {

$user.pwdlastset = 0

Set-ADUser -Instance $user

$user.pwdlastset = -1

Set-ADUser -Instance $user

}

Open in new window

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
Cedar Crest CollegeAuthor Commented:
Thank you!  I downloaded Bulk AD Users from Wisesoft, it did the trick!!
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
Scripting

From novice to tech pro — start learning today.