This is the script I have, but something is not right.
Import-Module ActiveDirectory
$computers = get-content "C:\disabled computer.txt"
foreach-object{
$computer | disable-adaccount
$computer | move-adobject -targetpath "ou=Disabled computers,dc=Domain,dc=com"
write-host “$computer will be moved to Disabled Computer OU”
}
Anyone can help?
Thanks