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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PasswordExpired Attribute + VBScript.

Status
Not open for further replies.

purephase

Technical User
Oct 23, 2003
13
CA
I'm trying to add a bunch of users via a script and a delimited file.

Here's the snippet:

objUser.AccountDisabled = False
objUser.Put "PasswordExpired", 1
objUser.Put "pwdLastSet", 0
objUser.SetInfo

It is all working except the "PasswordExpired" option, which according to all I've read is correct for forcing the users to reset their passwords the first time they login.

However, when the script is run it errors on the subsequest SetInfo since "The specified directory service attribute or value does not exist".

Has anyone else ever encountered this? Even using ADSI Edit I cannot see the PasswordExpired attribute in the Optional list for a user object.

Any help would be appreciated. Thanks.
 
Hey, thanks for the reply.

I'll check out scriptomatic, but for now, I did figure out the solution.

objUser.Put "pwdLastSet", 0

This is all I needed. It does what:

objUser.Put "PasswordExpired", 1

was supposed to do. I'm not sure how anyone ever got the latter to work, and I've seen it in a lot of documentation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top