Deleting Multiple AD users

Dean

Distinguished
Apr 15, 2004
144
0
18,680
Archived from groups: microsoft.public.win2000.active_directory (More info?)

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.
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.active_directory (More info?)

Dean wrote:
> 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)


--
Tomasz Onyszko [MVP]
T.Onyszko@w2k.pl
http://www.w2k.pl