What's in your servers.txt file? If you're using the "-Identity" parameter in the Get-ADComputer that parameter only accepts a distinguishedName, a GUID, a SID, or a sAMAccount as a value. If your file contains only the names of computers you'll have to use -Filter instead of -Identity.
Assuming you have just computer names in that file, your script should look something like this:
foreach ($server in (Get-Content C:\Scripts\servers.txt)) {
$test = Get-ADComputer -Filter { Name -eq $server }
if ($test) {
Write-Output "Server object $server exists in AD" | Out-File C:\Scripts\AD_result.txt -Append
}
else {
Write-Output "Server object $server does not exist in AD" | Out-File C:\Scripts\AD_result.txt -Append
}
}
When you use a filter there should never be an exception, so there's need/benefit to using a Try/Catch. Instead, just test the result to see if anything was returned.