Hi All,
I am using a VB script to get a directory listing of the Domino NAB using LDAP. I do get all the ‘People’ in the NAB, but we also need to get complete mail-in database list using the script. Is there any other setting under LDAP on Domino or do I need to modify my script?
Is there someone who can help me? Here is the script I am using:
Set oArgs = WScript.Arguments
ArgNum = 0
sArg0 = oArgs(ArgNum)
iCount = 0
Set fs=CreateObject(“Scripting.FileSystemObject”) 'used in creating text file
Set userFile=fs.createTextFile (“AUTO.TXT”) 'used in creating text file
userFile.Write “/CLEAR: _approved_local_address” & VbCrLf
userFile.Write “/MODIFY: _approved_local_address” & VbCrLf
Set objConnection = CreateObject(“ADODB.Connection”) 'used in creating dbase to import ldap requests for exporting
objConnection.Open “Provider=ADsDSOObject;” 'used in creating dbase to import ldap requests for exporting
Set objCommand = CreateObject(“ADODB.Command”) 'used in creating dbase to import ldap requests for exporting
objCommand.ActiveConnection = objConnection 'used in creating dbase to import ldap requests for exporting
'Next line has LDAP query for LDAP server
objCommand.CommandText = “<LDAP://” +sArg0 +“:390>;(&(objectClass=organizationalperson));mail;subtree”
Set objRecordSet = objCommand.Execute 'performs ldap query with results stored in Recordset
On Error Resume Next 'Picked up an error or 2 during next step but seems to get all addresses
Dim AddressArray
While Not objRecordset.EOF
AddressArray = objRecordset.Fields(0).Value
smtpAddress = AddressArray(0)
If Len( smtpAddress ) > 0 Then
Wscript.echo " " & smtpAddress
userFile.Write "+" & TRIM(smtpAddress) & VbCrLf 'write address to file then send carriage return line feed
if instr(TRIM(smtpAddress),"_") then
userFile.Write "+" & Replace(TRIM(smtpAddress), "_", "-") & VbCrLf 'write address to file then send carriage return line feed
end if
iCount = iCount + 1
End If
objRecordset.MoveNext
Wend