Disabling and Moving Computer Objects

$Computers = Get-Content c:\temp\computers.txt

ForEach ($Computer in $Computers)

{ $ADComputer = $null

$ADComputer = Get-ADComputer $Computer -Properties Description

If ($ADComputer)

{ Add-Content c:\temp\computers.log -Value "Found $Computer, disabling and moved to Disabled Computers OU"

Set-ADComputer $ADComputer -Description "Computer Disabled on $(Get-Date)" -Enabled $false

Move-ADObject $ADcomputer -targetpath “OU=Computers,OU=Terminated Users,DC=contoso,DC=local”

}

Else

{ Add-Content c:\temp\computers.log -Value "$Computer not in Active Directory"

}

}