Introduction to Setting Passwords
Note 1 : I have a new script to Set Passwords Note 2: I have a new script to force users to
change password at next logon When it comes to creating users, VBScript has a great advantage over
CSVDE and that is it can set user passwords. Another benefit of using
VBScript it that you can change properties in general, and passwords in
particular. CSVDE only adds NEW user and computer objects to Active Directory.
As well as showing you how to master the .SetPassword command, I have
alternative examples which make learning points about space as in white
space; and also the use of variables.
VBScript Example 1
' VBScript to create set a user's password
' Guy Thomas - January 2004
Set objUser = GetObject _
("LDAP://cn=Jeff1,ou=Droitwich,dc=cp,dc=com")
objUser.SetPassword "ip23kpy*o"
Wscript.Echo "Password Changed"
Note 1: The power of this VBScript comes from the
GetObject and the .SetPassword verbs.
Note 2: If you try this script, then alter the LDAP path
cn=Jeff1,ou=Droitwich,dc=cp,dc=com to reflect your domain and OU.
Note 3: The WScript.Echo statement is not strictly necessary
in this password script, but I like confirmation that action took place.
|