Getting User Information from Active Directory via ASP/LDAP Provider 
Author Message
 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



Mon, 02 Feb 2004 23:28:31 GMT  
 Getting User Information from Active Directory via ASP/LDAP Provider
Josh,

Try test.get("displayName") instead of test.displayName, etc...

-MD-


Quote:
> 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



Tue, 03 Feb 2004 04:00:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Modifying Active Directory information via script

2. Getting Active Directory SITE Information.

3. User Information from Active Directory

4. getting user information via WSH

5. ASP Active Directory User Verification

6. LDAP Connection to Active Directory.

7. LDAP Secure connection to Active Directory

8. Access internet directory via LDAP?

9. Access internet directory via LDAP?

10. Access internet directory via LDAP?

11. Query Active Directory for User's Home Directory Path

12. need vb script to change users home directory in on fell swoop (active directory)

 

 
Powered by phpBB® Forum Software