Deleting Multiple AD users

D

Dean

Please help! I have around 2500 AD user accounts to delete from our
AD. As you can imagine, I am not keen to go through each one and
delete them so I was hoping someone knew of a way to delete them using
an automated process.

Thanks in advance.
 
T

Tomasz Onyszko

Dean said:
Please help! I have around 2500 AD user accounts to delete from our
AD. As you can imagine, I am not keen to go through each one and
delete them so I was hoping someone knew of a way to delete them using
an automated process.

Sample script to delete user form AD
===
Set objOU = GetObject("LDAP://ou=hr,dc=fabrikam,dc=com")
objOU.Delete "user", "cn=MyerKen"
===

So You can use this sample and enhance it to get list of users from the
data file or selecting them with query from AD

But be _VERY_ careful and test this script strongly in Virtual labb for
example before running it in Your AD domain

Here You will find example ow to create users using data from the plain
file - and deleting them is simple modification (sorry that comments are
in polish)
http://www.w2k.pl/tech/sample2_2.txt

Here You will find example how to query AD for a users:
http://www.w2k.pl/tech/sample1_SQL.txt

(sorry once again for polish comments)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top