+ Post New Thread
Results 1 to 4 of 4
Web Development Thread, Staff Directory in Coding and Web Development; I would like to create a staff directory that can be viewed on our Intranet that looks something like the ...
  1. #1

    Join Date
    Sep 2007
    Posts
    181
    Thank Post
    4
    Thanked 2 Times in 2 Posts
    Rep Power
    15

    Staff Directory

    I would like to create a staff directory that can be viewed on our Intranet that looks something like the attached screenshot.

    HOWEVER, I want it to connect to active directory and get its data directly from there.

    Is this possible to achieve via using ASP?


    (See attached).
    Attached Images Attached Images

  2. #2

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,241
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    Yes this is reasonably easily done, you are after a technology called ADSI. Here are some links to the basics of grabbing the information:

    Learn More about ADSI

    Using ADSI in ASP

    Just make sure that the account that your ISS server is using has permission to access AD information ie Domain User.

  3. #3

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,241
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    This could be what you are after the ADSI Scriptomatic a shiny little MS tool that automagicly generates ADSI queries. You can then put these into an asp page or use them as vbs scripts.

  4. #4

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,241
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    Don't give up that easily, here is a script that I just created that does what you are after. At the moment it will output the names of all members of the domain admins group assuming they have stuff set for firstname and lastname in AD.

    Code:
    strContainer = "cn=Users"
    strName = "Domain Admins"
    
    On Error Resume Next
    
    '***********************************************
    '*          Connect to an object                 *
    '***********************************************
    Set objRootDSE = GetObject("LDAP://rootDSE")
    If strContainer = "" Then
      Set objItem = GetObject("LDAP://" & _
        objRootDSE.Get("defaultNamingContext"))
    Else
      Set objItem = GetObject("LDAP://cn=" & strName & "," & strContainer & "," & _
        objRootDSE.Get("defaultNamingContext"))
    End If
    '***********************************************
    '*         End connect to an object           *
    '***********************************************
    
    strmember = objItem.GetEx("member")
    For Each Item in strmember
     If Item <> "" Then
     Set objItem1 = GetObject("LDAP://" & Item)
     strFirstName = objItem1.Get("givenName")
     strinitials = objItem1.Get("initials")
     strSirname = objItem1.Get("sn")
    ' **** Usage in VBS ******
     WScript.Echo strFirstName & " " & strinitials & " " & strSirname 
    ' **** Usage in ASP ******
    ' response.write strFirstName & " " & strinitials & " " & strSirname & "<br>"
    End If
    
    Next
    Just change the strName variable to the group that you are after and the strContainer variable to the ou that the group is in ie ou=Groups or just leave it as is if the group is in or under the users folder. You can just chuck this in to a text file with a .vbs extention and run it on and domain connected machine to test it out.
    Last edited by SYNACK; 12th February 2008 at 12:31 PM.

  5. 2 Thanks to SYNACK:

    AnnDroyd (1st May 2008), plock (13th February 2008)

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 28
    Last Post: 15th August 2010, 09:47 AM
  2. Replies: 7
    Last Post: 31st January 2008, 12:17 PM
  3. PDA and Active Directory
    By localzuk in forum Windows
    Replies: 4
    Last Post: 10th October 2007, 03:54 PM
  4. Modifiying .ini's within a certain directory
    By Jenko22 in forum Scripts
    Replies: 6
    Last Post: 13th August 2007, 04:25 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •