Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
5 lines (3 sloc) 240 Bytes
$ADServer = "Domain-Controller-server"
$OUList = @('OU=OUcontainer1,DC=corp,DC=domain,DC=com','OU=OUcontainer2,DC=corp,DC=domain,DC=com')
$OUList | ForEach-Object {Get-ADUser -server $ADServer -Filter * -SearchBase $_ | Disable-ADAccount}
You can’t perform that action at this time.