How to enable user account in Active Directory through vbscript

Below is the sample vbscript to enable the user from Active Directory

Set objOU = GetObject("LDAP://TestDC/OU=TestUO,DC=Test,DC=com")
Set objUser = GetObject("LDAP://CN=TempUser,OU=TestOU,DC=Test,DC=com")
objUser.AccountDisabled = FALSE
Wscript.echo "Successfully enabled TempUser from Test.Com"

Note: Before executing above script please make sure that the user with samaccount name TempUser exist in the domain and OU with name TestOU exists under Test.Com root container.


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