Solved

script to delete all the objects in AD.

Posted on 2014-12-16
2
90 Views
Last Modified: 2014-12-18
Hello, I need the script to delete all the objects in AD. I didn't import successfully into the test lab and need to start from scratch.

Could anyone please provide the script to remove all objects from AD.
THanks. No worries. I am doing it in the test lab not in the prod :)
0
Comment
Question by:creative555
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
Dan McFadden earned 500 total points
ID: 40504509
I wouldn't recommend running a script against AD that deletes all objects.  It would render AD useless.

When you say that you need to start from scratch, do you mean:

1. reinstall server OS
2. dcpromo a server
3. configure first server in forest

Dan
0
 

Author Closing Comment

by:creative555
ID: 40507518
Thanks for the useful comment. It would. I got the script that would delete OUs and all its objects so I can start my lab from the scratch without reinstalling AD.

I used DSRM command and it worked great:
dsrm -subtree -noprompt "OU=Test2OU,DC=test,DC=lab,DC=com"
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question