Strange problem: LDAP from WSH/VBS - impossible to get any fields!

Hi all,

I have a very strange problem. I need some information of the notes-users from Netinstall (like MS SMS). I find a possbility to make a query over LDAP from WSH-Script. I can read f.e. the follwing fields from the domino-directory:

  • cn

  • url

  • mail

  • sn

But i need the following fields too:

  • mailserver

  • maildomain

  • mailfile

This script works for the first fields, but not for all fields (mailserver, etc):

serverName = “neu-not01.ch-neu-hartmann.corp.intl”

baseStr = “”

filterStr = “(&(objectClass=dominoPerson) (sn=Kaifer) (givenname=Stefan))”

'Ir works:

fieldsStr=“cn,url”

'It not works!!!:

'fieldsStr=“maildomain,mailserver,mailfile”

Set ado = CreateObject(“ADODB.Connection”)

ado.Provider = “ADSDSOObject”

ado.Properties(“User ID”) = “CN=Admin Account,OU=IVF,O=PHAGHDH,C=DE”

ado.Properties(“Password”) = “password!”

ado.Properties(“Encrypt Password”) = False

ado.Open “LDAPNotes”

Set adoCmd = CreateObject(“ADODB.Command”)

adoCmd.ActiveConnection = ado

adoCmd.Properties(“Page Size”) = 500

adoCmd.Properties(“Cache Results”) = True

adoCmd.CommandText = “<LDAP://” & serverName & “>;” & filterStr & “;” & fieldsStr & “;subtree”

Set adoRS = adoCmd.Execute

While Not adoRS.EOF

For a = 0 To adoRS.Fields.Count - 1

    WScript.Echo adoRS.Fields(a).Name

    'For Each SubValue in adoRS.Fields(a).Value

        'Wscript.Echo(SubValue)

    'Next

Next ' ndx

adoRS.MoveNext

Wend

if I would get the fields “maildomain,mailserver,mailfile”^, then I’ll get a WSH-error.

If I try to browse the domino-directory with the tool “LDAP Browser” (http://www.softerra.com/download.htm), then I can see all fields (maildomain,mailserver,mailfile, etc. too).

Has somebody an idea, how can I get these 3 fields over LDAP in a WSH/VBS-Script?

Thanks

Stefan

Subject: Strange problem: LDAP from WSH/VBS - impossible to get any fields!

I have a very strange problem. I need some information of the notes-users from Netinstall (like MS SMS). I find a possbility to make a query over LDAP from WSH-Script. I can read f.e. the follwing fields from the domino-directory:- cn

  • url

  • mail

  • sn

Make sure the credentials you are using have access to those fields. Perhaps you are using different credentials when you are running Softerra?

You can also try the ldapsearch tool. Also, LDAPDEBUG=1 will reveal what the Domino LDAP server is processing.

Subject: Strange problem: LDAP from WSH/VBS - impossible to get any fields!

Hi Stefan,

if your User and password are correct, may be your problem is a port problem. Did you try a LDAP request with the port number 389 enter after the server name ? for example :

adoCmd.CommandText = “<LDAP://” & serverName & “:389>;” & filterStr & “;” & fieldsStr & “;subtree”

I’m used to execute this kind of query but I prefer make a “select * from” instead of your method. For example :

adoCmd.CommandText = “SELECT * FROM 'LDAP://” & serverName & “:389’ WHERE objectClass=‘DominoPerson’ And sn=‘Kaifer’ And givenname=‘Stefan’”

Let me know if it works or not, bye

Patrick