That's why I was filtering on "Name:" - that's the data returned from NSLookup.

I might consider something like:
 Code:
$Intermediate = Split($_oExec.StdOut.ReadAll, @CRLF)
Select
 Case AScan($Intermediate, 'Non-existent')
  $NsLookup = ''
  Exit -4
EndSelect

Don't have time now to flesh this out, but basically - create a case statement to look in the array for specific errors, then do the trim/join/split/join to return the valid data. Define a separate exit code for each error condition - use negative numbers to indicate that the data is invalid, as opposed to positive numbers to indicate a "real" error condition.

Hack away, and post it back here - I'll pitch in when I have some time, but it might not be for a day or so.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D