Deleting Multiple Users from AD

  • Thread starter Thread starter Dean
  • Start date Start date
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.
 
You might want to post in the microsoft.public.win2000.active_directory
group for more 'attention'

Ken
 
Are they in a separate OU or scattered around your OU design?

Regards,
/Jimmy
 
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.

There are a number of ways to do this.
If you have a text file that contains the userId, 1 per line:

for /f "Tokens=*" %%u in (filename.txt) do (
net user %%u /DOMAIN /DELETE
)

You can use the Active Directory commain-line tools, tip 6820 in the 'Tips & Tricks' at http://www.jsiinc.com.
for /f "Tokens=*" %%u in (filename.txt) do (
dsquery user -samid %%u | dsrm -noprompt
)


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top