[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Set pwdlastset to -1

Posted on 2013-11-21
1
Medium Priority
?
803 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

650 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