I think you should stick with fnLDAPQuery(). If you get the hang of it, you'll find it a very powerful tool for querying Active Directory.

Code:

$aWhat = "sAMAccountname","ADsPath"
$sSAM = $textbox1.text
$sWhere = "(&(objectCategory=person)(objectClass=user)(SAMAccountname="+$sSAM+"))"
$aResults = fnLDAPQuery($aWhat,,$sWhere)
If UBound($aResults) < 0
MessageBox("User ID not found","Notice",64)
$Label1.Width = 58
$Label1.Text = "User ID: "
$TextBox1.Visible = "True"
Exit (1)
Else
$aResults[0,0] ? ; The user's sAMAccountname
$aResults[0,1] ? ; The user's ADsPath
EndIf