Skip to content

Instantly share code, notes, and snippets.

@a73xsh
Last active June 21, 2018 12:56
Show Gist options
  • Save a73xsh/91a2c3e3b71686781563ede7586d77cc to your computer and use it in GitHub Desktop.
Save a73xsh/91a2c3e3b71686781563ede7586d77cc to your computer and use it in GitHub Desktop.
Remove-ADTrustdomain
$Domainlist = Import-Csv -Path DomainList.csv
foreach ($domain in $Domainlist){
netdom trust lab.local /Domain:$($domain.name) /remove /Force /verbose
write-host "Trist domain $($domain.name) deleted"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment