remove all users from all ou's
Posted on 2016-09-01
I have a home lab and testing some scripts. How can I delete all users from all OU's and ou's within ou's? I can delete all users in an ou with this. But within that OU I have about 10 different ou's and I have about 20 ou, with 10 different ou's within each.
Get-ADUser -Filter * -SearchBase "OU=Students,OU=Peabody,DC=homelab,DC=COM" | Remove-ADUser