Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scirpt - all accounts be prompted to reset password?

Status
Not open for further replies.

bran2235

IS-IT--Management
Feb 13, 2002
703
US
Hello, everyone-

Does anyone have a script I can run that will set the "require user to reset password at next login" option for all user accounts?


Thanks,
Brandon
 
See if this one will work for you.

dsquery user domainroot | dsmod user -mustchpwd yes


Joey
A+, MCP
 
I'm willing to try but not on my entire domain :)

What would the cmd be to just try a single user?

THANKS!
Brandon
 
Try this one for a single user where username= the users login name. You could also use the users UPN.

dsquery user -u domain\username | dsmod user -mustchpwd yes

Joey
A+, MCP
 
Why can you just use AD Users and Compupters, select all users you want to force a password change and check the box that says User must change password on next logon
 
I need to change about 900 users ... at once... via a script if possible..

Here's the question... Is there a script I can use that I CAN SPECIFY each user... maybe a batch file that just reads one line at a time?

Thanks!!
Brandon
 
With all due respect, you'd spend more time just writing a batch file than if you followed KRPGroup's suggest and just highlight all of the users and do it at one time (or at least do the users in a specific OU at one time).

And, FWIW, you don't need to dsquery before using dsmod.

Pat Richard, MCSE MCSA:Messaging CNA
Microsoft Exchange MVP
Want to know how email works? Read for yourself -
 
Using AD you have more control immediately (no testing) and if your using OU's you can do one at a time as well for further control and tracking whom has been done. Shift or CTRL your users 2 or 100+ users at a time...
 
Yes, but I would have to do this OU by OU *(thanks M$)*
 
To do everyone in the domain you ca use the Find feature in AD Users/Computer and then use the adv tab to really filter staff. Then you can select all at once, just be careful not to get system accounts, Administrators etc.. But again you can use the adv filter and use the conditions there eg "Is Not" to filter any accounts by many dif fields depending on how much you fill out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top