Trying to query Exchange 5.5 LDAP provider using VBScript 
Author Message
 Trying to query Exchange 5.5 LDAP provider using VBScript

Hello,
        I am not a programmer, but have pieced together some very basic WMI
scripts. My boss was impressed, but now I have been tasked over my
head, so any help would be greatly appreciated. We have WinNT domain,
so we have no Active Directory in place. But, we do have an LDAP
Directory Service from our Exchange server available. I am trying to
write a VBScript that will query our Exchange 5.5, LDAP Directory
Service for several specific attributes about a given user. The
information I have is the WinNT domain username. This equates to Alias
in the GAL. And, I believe this equates to cn in LDAP. What I want to
do is, pass strUserID as a variable, and retrieve: first name, last
name, office, phone, and email address, for the username in question.
I know the attributes for last name (sn) and email address (mail), but
I have been unable to find the others. This is a sample in which I was
trying to access LDAP to retrieve a user's email address. Am I on the
right track with this? I get a timeout error.

Option Explicit
'On Error Resume Next

Dim objLDAP, objData

strUserID = "WinNT Domain Username"

Set objLDAP = GetObject("LDAP:")
Set objData = objLDAP.OpenDSObject("LDAP://ldap.eaglegl.com:389/o=us",
_ "cn=strUserID,ou=Members,o=us",[password], 0)

wscript.echo "Email Address: " & objData.mail

Set objLDAP = nothing
Set objData = nothing



Sun, 17 Jul 2005 06:26:45 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Newbie Q Trying to connect to Exchange using Ldap

2. Newbie Q Trying to connect to Exchange using Ldap

3. LDAP access to Exchange 5.5 over Windows 2000

4. Query Exchange 5.5 directory

5. LPAD Query and Exchange 5.5

6. Using Crystal Reports 8.5 to Report Fields From Public Contacts Folder on Exchange 5.5 Server

7. How can I add a user to a Distribution List (DL) in Exchange 5.5 using VB

8. How can I add a user to a DL in Exchange 5.5 using ADSI

9. How to query a non-Windows LDAP server using ADSI and vbscript

10. LDAP Query for Exchange 2000

11. Exchange 5.5 Event Scripting - using ADO connections

12. Using WHS to modify Exchange 5.5 Account

 

 
Powered by phpBB® Forum Software