LDAP/Script Question....

While testing a GPO to require users to change passwords every 90 days...I accidently applied it.

Now all my off-site users who use OWA only can't log into OWA, needless to say they can't change their password.

I need to reverse that GPO settings and the only way to remove the "user must change password at next login" flag seems to be modifying this flag


to -1 instead of "0"

The script according to this KB article:  http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_akke.mspx?mfr=true

Gives me the following code

Set objUser = GetObject _
objUser.Put "pwdLastSet", -1

But how can I modify that LDAP query to say ALL USERS??

Unless of course I'm going about this the long way.  I simply want to reset the flag that says users must change password at next login to continue to let them use the password they already have.  Versus forcing them to change it.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You should look into using the DSQUERY and DSMOD tools to do this.

You would use DSQUERY to get a list of all users, then pipe the results to DSMOD, which would change that flag.

You can see this page as a reference.  You will need to modify their examples of course:

derrickonlineAuthor Commented:
Resolved my own issue....

Setting the password never expires flag took precedance over password already expired flag.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.