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
117 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
Let's recap what we learned from yesterday's Skyport Systems webinar.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

627 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