Untested. This is the basic program flow using VBS Dictionary Objects.
Code:

Dim $objDictionary1, $objDictionary2
$objDictionary1 = CreateObject("Scripting.Dictionary")
$objDictionary2 = CreateObject("Scripting.Dictionary")


; open and read file #1 (External Users DB)
Dim $Array, $x
IF Open(3, "C:\DATA\FILE1.TXT") = 0
$x = ReadLine(3)
WHILE @ERROR = 0
$Array = split($x,"#")

; Use the array element for the user account as the KEY.
; The value at this time does not matter so set it to 1
; This may change as the program evolves
DictionarySetValue($objDictionary1, $Array[1], "1")

$x = ReadLine(3)
LOOP
ENDIF

; open and read file #2 (AD users)
IF Open(3, "C:\DATA\FILE1.TXT") = 0
$x = ReadLine(3)
WHILE @ERROR = 0
$Array = split($x,"#")

; Use the array element for the user account as the KEY.
; The value at this time does not matter so set it to 1
; This may change as the program evolves
DictionarySetValue($objDictionary2, $Array[1], "1")

$x = ReadLine(3)
LOOP
ENDIF


; Which external users exist in AD
$colKeys = $objDictionary1.Keys
For Each $strKey in $colKeys
If $objDictionary2.Exists($strKey) Then
"Specified External User ($strKey) Exists in AD" ?
Else
"Specified External User ($strKey) DOES NOT Exist in AD" ?
;do something?
End If
Next
??

; Which AD users exist in the external User DB
$colKeys = $objDictionary2.Keys
For Each $strKey in $colKeys
If $objDictionary1.Exists($strKey) Then
"Specified AD User ($strKey) Exists in the External User DB" ?
Else
"Specified AD User ($strKey) DOES NOT Exist in the External User DB" ?
;do something?
End If
Next
??



function DictionarySetValue($DictionaryObject, $key, $value)
if vartypename($DictionaryObject) <> "Object"
exit 13
endif
if vartypename($key) = "Empty"
exit 13
endif

if $DictionaryObject.Exists($key)
$DictionaryObject.Remove($key)
endif

$DictionaryObject.Add($key, $value)
exit @error
endfunction

_________________________
Home page: http://www.kixhelp.com/hb/