7,023 questions
Hi, TJCooper
This is Chaboon.
I seem it is simplest solution, you use New-PSDrive with PowerShell, connecting Active Directory.
see Below the code:
Import-Module ActiveDirectory
New-PSDrive -name MyAD -psprovider ActiveDirectory -Root "OU=Target,DC=example,DC=com" -server dc00.example.com
cd MyAD:
$Groups = Get-ChildItem | Where {$_.objectClass -eq "Group"}
# if you want to find recursive objects
# $Groups = Get-ChildItem -recurse | Where {$_.objectClass -eq "Group"}
ForEach ($Group in $Groups) {Write-Host $Group is delete! ; Remove-ADGroup $Group -confirm:$false}