Wednesday, November 26, 2008

Deleting a User Account from Active Directory

Deletes the user account for MyerKen from the HR organizational unit in a hypothetical domain named fabrikam.com.

Set objOU = GetObject("LDAP://ou=hr,dc=fabrikam,dc=com")
objOU.Delete "user", "cn=MyerKen"

This is a VB Script, this can be used by saving the file in .vbs file