Solved

How to force users to change NT password

Posted on 2014-04-23
3
259 Views
Last Modified: 2014-04-23
Hello,

Is there a way to run a script, command or something to force users to change their NT password on their next logon? We can force it by checking the box under Account tab on Users/Computers but it will be hard to do that with over 500 users.

Thank you in advance!
0
Comment
Question by:Help DeskLF
  • 2
3 Comments
 
LVL 28

Expert Comment

by:becraig
Comment Utility
you should be able to do this with set-aduser

Something like below should work.
What it does principally is set the flag to 0 so the user has to change their password the next time they login.
import-module ac*
gc users.csv | %{
$samaccountname = $_
Get-ADUser $samaccountname -Properties pwdLastSet   | Set-ADUser -Instance $_.pwdLastSet = 0 
}

Open in new window


One of the PS gurus could probably make this a lot cleaner but that is the idea
0
 
LVL 9

Accepted Solution

by:
WebDevEM earned 400 total points
Comment Utility
Hi,

I would look at PowerShell for that... there's a conversation at http://community.spiceworks.com/topic/336109-need-to-force-all-users-to-change-password-at-next-logon which has some good discussion and examples.  The basic idea is this:
get-aduser -Filter * -SearchBase "OU=Users,DC=example,DC=com" | set-aduser -ChangePasswordAtLogon $True

Open in new window


Hope this gets you on the right track - I'm fairly new to PS scripting, but that seems to be the way to go for something like this.

WebDevEM
0
 
LVL 28

Expert Comment

by:becraig
Comment Utility
you can also if you have the user SAM accounts run

import-module ac*
gc users.csv | %{
$samaccountname = $_
Set-ADUser -Identity $samaccountname -ChangePasswordAtNextLogon $true
}
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now