Why not select the entire list, right click, Prop, Account, check Password never expires. Do you really need a dsmod command
Main Topics
Browse All TopicsI would like to have the following as loop for all users in a OU
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
Set objUser = GetObject _
("LDAP://DC=xxx,DC=xxx, OU=xxx")
intUAC = objUser.Get("userAccountCo
If ADS_UF_DONT_EXPIRE_PASSWD AND intUAC Then
Wscript.Echo "Already enabled"
Else
objUser.Put "userAccountControl", intUAC XOR _
ADS_UF_DONT_EXPIRE_PASSWD
objUser.SetInfo
WScript.Echo "Password never expires is now enabled"
End If
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
See this link:
http://www.microsoft.com/t
Might take you a little while to set it up, but once you got its great.
Business Accounts
Answer for Membership
by: henjoh09Posted on 2008-06-02 at 09:22:19ID: 21693345
To modify all users in an OU, just parse the output from dsquery
cal|dsmod user -mustchpwd yes
C:\>dsquery user OU=ou-path,DC=domain,DC=lo