'************************************************** ' ' This script deletes the passed in user from the passed in OU ' To run: cscript deleteuser_adam.vbs ADsPath UserName ' Examples: cscript deleteuser_adam.vbs LDAP://localhost:389/ou=testou,c=us testuser ' '************************************************** set Args = Wscript.Arguments ouName = Args(0) objdel = Args(1) ' If the application OU DN is "ou=adamou,c=us" and the server is "adamhost" and the port is 389. Then the parameter ouName should be passed ' as follows: "LDAP://adamhost:389/ou=adamou,c=us" set ou = GetObject(ouName) ou.Delete "user", "CN=" & objdel wscript.echo "User " & objdel & " was deleted succefully"