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
objUser.SetInfo
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.

Comments

Popular posts from this blog

How to boot Samsung Galaxy SL( GT-I9003) in recovery mode

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

How to Factory Reset or Hard Reset Samsung Galaxy SII ( GT-i9100)