break ON
$test1="aber.nade" ; The period in this account name causes the IDispatch error
$str=""
$server=""
adsearch($test1)
? $str
? $server
Function ADSearch($ADAccountName)
Dim $AdoCon
dim $AdoCommand
dim $Recordset
dim $Filter
dim $homemdb
dim $store
if len($ADAccountName)>0
$filter=" where samAccountName='"+$ADAccountName+"' "
$AdoCon = CreateObject("ADODB.Connection")
$AdoCon.Provider = "ADsDSOObject"
; Current credentials are used, as username and password aren't specified
$AdoCon.Open("Active Directory Provider")
; Create ADO command object for the connection.
$AdoCommand = CreateObject("ADODB.Command")
$AdoCommand.ActiveConnection = $AdoCon
$AdoCommand.CommandText ="Select homemdb from
'LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")+"' "+$filter
; Execute the query.
$Recordset = $AdoCommand.Execute
$homeMDB=split($recordset.fields("homemdb"),",") ; This gives the error
$store=split($homemdb[0],"=")
$str=$store[1]
$server=right($homemdb[3],4)
Else
Exit
endif
Endfunction