WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Force Password Change for ADSI User


Question:

How can I automaticly save with a new account (made with newUser.wbt) that a user must change password after next logon?

Answer:

To force the user to change the password on next login you need to make sure they can reset there password and then expire the existing password. Here is an example that will, hopefully, get you started:
; Make sure the don't expire password is *not* set.
UF_DONT_EXPIRE_PASSWD = 65536
sProperty = "userAccountControl" 
sValue = dsGetProperty(sUser, sProperty)
sValue = sValue & (~UF_DONT_EXPIRE_PASSWD) 
dsSetProperty(sUser, sProperty, sValue)


;Set the expire time
sProperty = "pwdLastSet"; - set to 0 to cause change next login. 
sValue = 0 
dsSetProperty(sUser, sProperty, sValue)

Article ID:   W15812
File Created: 2004:03:30:15:40:58
Last Updated: 2004:03:30:15:40:58