Chris,

fnLDAPQuery() seems to do the trick!

However, it seems with some of the employees (very few) there are two and three of them in my log file that I am using for testing.

Here is the code now:
Code:

CLS
BREAK ON

$logfl='H:\Gemini Move\phon.csv'
IF EXIST($logfl)
DEL $logfl
ENDIF
$oxl=Createobject('Excel.application')
;Check to insure that Excel is available
IF 0<>@error ?@error ' Excel Application is not found'
SLEEP 4
RETURN
ENDIF
$rc=$oxl.workbooks.open("H:\Gemini Move\AD Logins.xls")
$row=1 ;Row to start at using column headings, change to 0, if needed
WHILE $oxl.cells($row,1).value<>'' ;need a value each time in column 1
$row=$row+1
IF $oxl.cells($row,1).value='' ;Once it gets to a blank row...
$oxl.quit ;quit Excel
$oxl=0 ;set the object to 0
ELSE
$fname=$oxl.cells($row,2).value
$lname=$oxl.cells($row,3).value
$fullname=$fname+' '+$lname
;?$fullname
$aattributes = "Name", "AdsPath"
$sadspath = "LDAP://"+GetObject("LDAP://rootDSE").get("defaultNamingContext")
;$strFilter = "(&(objectClass=User)(Name=*))"
$strfilter = "(&(objectClass=User)(Name="+$fullname+"))"

$aresults = fnLDAPQuery($aattributes,$sadspath,$strfilter,"Name")
;@error " | " @serror ;?
FOR $r=1 TO UBound($aresults,2)
$aresults[$c,$r]; ?
$user = GetObject($aResults[$c,$r])
?RIGHT($user.name,LEN($user.name)-3)
?$user.telephonenumber
; -- Set the new Phone Number
;$user.Put("telephoneNumber", "(000) 123-"+$oxl.cells($row,4).value)
;$user.SetInfo
NEXT
LOGGER($logfl,RIGHT($user.name,LEN($user.name)-3)+','+$user.telephonenumber+@CRLF)
$fullname=""
ENDIF
LOOP
?"Process is complete.. Press a Key"
GET $



Thanks again,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's