How to set password for users in Active Directory through vbscript
Below is the sample vbscript to set password for Users in Active Directory
|'First connect to container (OU) under which we will create user|
Set objUser = GetObject("LDAP://cn=TempUserName,OU=TestOU,DC=TEST,DC=COM")
'Also set password never expires
objUser.Put "PasswordExpired", CLng(1)
Wscript.echo "Sucessfully Set password for user TempUser"
Code above connects to the active directory object with CN=TempUser, ( connects to user TempUser) under TestOU, domain Test.com. The SetPassword will set the provided password for user and additionally we can set Password Never expires flag for that user.