?
Solved

Set pwdlastset to -1

Posted on 2013-11-21
1
Medium Priority
?
809 Views
Last Modified: 2013-12-16
I need to change a group of users so that all their passwords show they changed it -1 day before this way there passwords will not need to be reset for another 90 days and it does not require them to change their PW right now but instead keeps the one they have in place for 90 more days.  If theres an easier way to do this please let me know other wise my thoughts were change the pwdlastset to -1

TY
0
Comment
Question by:Twhite0909
1 Comment
 
LVL 40

Accepted Solution

by:
Subsun earned 2000 total points
ID: 39667237
If you have a list of users in a text file and Windows 2008 R2 Domain controllers, then try..
Import-Module Activedirectory
Get-Content C:\User.txt | % {
 Set-ADUser $_ -Replace @{pwdLastSet="-1"}
}

Open in new window

Sample C:\User.txt file format..
UserA
UserB
UserC

Open in new window

0

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Question has a verified solution.

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

Let's recap what we learned from yesterday's Skyport Systems webinar.
A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

840 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