
Getting User Information from Active Directory via ASP/LDAP Provider
Hello All,
I'm having trouble pulling user information from Active Directory via an ASP
script. I am able to get some information, just not all I need. what I'm
ultimately trying to do is grab the data in a user's department property so
I can use it to redirect them to the appropriate page on our intranet.
Here's some code and the output, which demonstrates the problem:
----Code Snippet
Set test =
GetObject("LDAP://[servername]/CN=JoshF,CN=Users,DC=suntech,DC=com")
Response.Write "Name: " & test.Name & "<br>"
Response.Write "Class: " & test.Class & "<br>"
Response.Write "GUID: " & test.GUID & "<br>"
Response.Write "ADsPath: " & test.ADsPath & "<br>"
Response.Write "Parent: " & test.Parent & "<br>"
Response.Write "Schema: " & test.schema & "<br>"
Response.Write "Display Name: " & test.displayName & "<BR>"
Response.Write "SN: " & test.sn & "<BR>"
Response.Write "Email: " & test.mail & "<BR>"
Response.Write "Department: " & test.department & "<BR>"
Response.Write "Given Name: " & test.givenName & "<BR>"
----Output
Name: CN=JoshF
Class: user
GUID: 7654f60e49e0ed4ca90556d0aa8bb42a
ADsPath: LDAP://[server]/CN=JoshF,CN=Users,DC=suntech,DC=com
Parent: LDAP://[server]/CN=Users,DC=suntech,DC=com
Schema: LDAP://[server]/schema/user
Display Name:
SN: Fowler
Department:
Given Name: Josh
----
As you can see, only certain bits of information are being pulled from AD. I
was thinking that this may be a permissions problem, so I disabled anonymous
access in IIS and enabled Basic Authenticated with Integrated Windows
Authentication, and I'm still running into the same problem, even when
signed in as an administrator. I know that the department property is
populated (as well as the displayName property, for that matter), as I
entered the info into Active Directory Users & Computers, and am able to
view the data in ADSI Edit.
I'm at a loss at this point -- I know that there are some properties that
are unsupported using thw WinNT provider (such as Department), which is why
I'm trying to use LDAP. Are there properties that are not available in LDAP,
either?
Any help would be greatly appreciated!
Thanks for your time,
Josh Fowler