Tuesday, January 8, 2019

Remove Computers from txt list powershell

Import-Module ActiveDirectory
$PCs = Get-content c:\tmp\fordisable.txt
foreach ($PC in $PCs)
{
Remove-ADComputer -server test.local -identity $PC -confirm:$false
}

No comments: