Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

ASP accessing exchange directory

I need to create an ASP page that will list my exchange users in tabular format. When the user clicks on someones name then a detail page will come up.

I have tried to modify the find user script which is shipped with the web version of outlook in exchange 5.5 but have had all sorts of problems.

I'm now looking at the possibility of writing something from scratch, maybe using COM or even OLE-DB.

Does any one know how to access the exchange directory from an ASP page ?

Daniel.
0
DanielGarcia
Asked:
DanielGarcia
  • 2
  • 2
1 Solution
 
DanielGarciaAuthor Commented:
Edited text of question
0
 
percynCommented:
You will have to use CDO (Active Messaging) to access the exhange server and give you the list of all the users for a particular exchnage domain.

0
 
Technocrat062397Commented:
You could also use LDAP
0
 
percynCommented:
Here is an example of how you can use ASP and ADSI. Just modify the search criteria to match your needs.

The code below will find mailboxes in the Exchange directory services whose 'City' property matches the search ‘criteria. The ADSI LDAP name for 'City' property is 'l.'

Dim objADOconn ' ADO connection object
Dim strADOQueryString ' ADO query string
Dim objRS  ' recordset object
Dim strCriteria  ' value used to search the directory tree
strCriteria = "Bellevue"

Set objADOconn = CreateObject("ADODB.Connection")
objADOconn.Provider = "ADSDSOObject"
objADOconn.Open "ADs Provider"
strADOQueryString = "<LDAP://" + strServer + ">;(&(objectClass=organizationalPerson)(l=" + strCriteria + "));cn,adspath;subtree"
Set objRS = objADOconn.Execute(strADOQueryString)
If Not objRS.EOF Then
 While Not objRS.EOF
   objNewDL.Add objRS.Fields(1).Value
  Response.Write objRS.Fields(0) + " added :)<BR>"
  objRS.MoveNext
 Wend
Else
  Response.Write "No mailboxes were added to the DL :(<BR>"
End If
objRS.Close


0
 
DanielGarciaAuthor Commented:
Thank you very much for your answer. Sorry it took a while to get back to you.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now