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
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...
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.