Advertisement

12.03.2008 at 06:25AM PST, ID: 23953190 | Points: 500
[x]
Attachment Details

Get access to a property with directorysearcher but not directly

Hi!

First, my question targets a Lotus-Directory, which is LDAP-enabled but maybe someone could help me anyway.

I have a user in a Lotus-Directory named 'Jan'. I want to read the property 'fullName' of it.

Using the directorysearcher, it works:

Dim DE As New DirectoryEntry(LDAP://notesserver, "adminuser", "adminpass", AuthenticationTypes.None)

Dim deSearcher As New DirectorySearcher(DE)

deSearcher.Filter = "(&(objectClass=person)(cn=jan))"

deSearcher.SearchScope = SearchScope.Subtree

deSearcher.PropertiesToLoad.Add("fullname")

Dim result As SearchResult = deSearcher.FindOne

MsgBox(result.Properties("fullname").Item(0).ToString)

Fullname has the correct value.

Then using this does not werk:

Dim deUser As DirectoryEntry = result.GetDirectoryEntry

MsgBox(deUser.Properties("fullname").Item(0).ToString)

Fullname is empty.

Even direct binding to the user does not work:

Dim UserDE2 As New DirectoryEntry("LDAP://notesserver/cn=jan,o=hansecom,c=de", "adminuser", "adminpass", AuthenticationTypes.None)

MsgBox(UserDE2.Properties("fullname").Item(0).ToString)

Fullname is empty.

Any ideas? Trying this with other properties works as expected.

Thanks!!!

Jan
Top Expert: graye
Expert Since: 10/12/2002
Accepted Solutions: 2141
Computer Expertise: Beginner
graye has been an Expert for 6 years 2 months, during which he has posted 6408 comments and answered 2141 questions. graye is just one of 2737 experts in the Microsoft Visual Basic.Net Zone.
 
 
 
 
20081119-EE-VQP-48 - Hierarchy / EE_QW_2_20070628