Solved

script to delete all the objects in AD.

Posted on 2014-12-16
2
76 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
2 Comments
 
LVL 26

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now