Solved

Ho do I start fresh and quickly remove about 50,000 objects from test AD that were unsuccessfully imported. Script is needed

Posted on 2014-12-16
7
115 Views
Last Modified: 2014-12-17
Hello,
I did a bad import of objects to the test AD lab and need to remove all objects. They located on many levels and sub OUs. Could you please help me with the script to get rid of them or maybe even the way to just remove entire AD quickly and start fresh.

Thanks
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
  • 4
  • 3
7 Comments
 
LVL 19

Expert Comment

by:Raheman M. Abdul
ID: 40504455
Try this and test on one OU: (To delete a container identified by its DistinguishedName including all child objects)
Remove-ADObject "OU=Finance,OU=London,DC=Mania,DC=COM" -Recursive

Open in new window

0
 

Author Comment

by:creative555
ID: 40505370
Where do I need to run it from? Does it have to be DC? It says unrecognized command
0
 

Author Comment

by:creative555
ID: 40505382
Also, is it possible to load the csv with DN column and specify through the command to remove objects in excel? WHat would be the command?

Thank you
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
ID: 40505396
Yes on DC, start "Powershell with active directory" or use import
otherwise install the active directory module from google
import activedirectory
Remove-ADObject "OU=Finance,OU=London,DC=Mania,DC=COM" -Recursive
                                          

Open in new window

0
 
LVL 19

Expert Comment

by:Raheman M. Abdul
ID: 40505423
Alternatively, follow the steps to completely remove AD from the server.

On DC, run  "dcpromo"
tick "Delete the domain" Next...
tick "Delete all applications..."   Next...

Reboot

Again from server manager, click "Remove Roles"  and uncheck "Active Directory Domain Services" -> Next...
Reboot
0
 

Author Comment

by:creative555
ID: 40505435
DOos it have to be 2008 DC? Can it be 2003 DC?
0
 
LVL 19

Expert Comment

by:Raheman M. Abdul
ID: 40505444
I guess it does not matter.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Search Windows logs for IP Address 10 47
Windows 7 - Password Expiry Message at Logon 6 46
RMS / DRM - differences? 3 45
Powershell Exchange - help using invoke-command 16 54
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

763 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