Solved

script to delete all the objects in AD.

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
A procedure for exporting installed hotfix details of remote computers using powershell
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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