Solved

script to delete all the objects in AD.

Posted on 2014-12-16
2
83 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 27

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
powershell code to list items in dropdown 6 60
Powershell out file or export to csv 2 46
Clear Filter 8 34
Restart service script 5 7
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
A brief introduction to what I consider to be the best editor for PowerShell.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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