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")

objUser.SetPassword "Testme123"
'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 The SetPassword will set the provided password for user and additionally we can set Password Never expires flag for that user.  


Popular posts from this blog

Error : login failed on rabbitmq web-management console

MSMQ error : "A workgroup installation computer does not support the operation."

How to flash CWM Recovery to Samsung Galaxy SL( GT-I9003) using Odin