Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

removing all Organizational Units via function

$
0
0

Hello everyone

in my test lab i was successful to create a function which creates some OUs in Active Directory.

but another function to remove them at once, doesn't work

functionMyremoveOUs{Get-ADOrganizationalUnit-filter *|Set-ADOrganizationalUnit-protect 0-ea ignoreGet-ADOrganizationalUnit-filter *| remove-ADorganizationalUnit-recursive confirm:$false  }


 

 

any help please 


Viewing all articles
Browse latest Browse all 6937

Trending Articles