found a nice article and it works: http://forums.asp.net/thread/1309113.aspx
But i also want to be able to edit the field, there is a link but it's all in C-sharp and i don't understand it.
could someone explain & intergrate it in my code :
Code:Dim filter As String = String.Format("(&(objectClass=user)(objectCategory=person)(sAMAccountName={0}))", Environment.UserName) Dim entry As New DirectoryEntry("LDAP://verelst.nw", "jkhadmin", "Tidus05") Dim searcher As New DirectorySearcher(entry, filter, New String() {"displayName", "streetAddress", "l", "st", "postalCode", "physicalDeliveryOfficeName", "mail"}) Dim fullName As String = "" Try Dim result As SearchResult = searcher.FindOne() If Not IsNothing(result) Then If (result.Properties.Contains("displayName")) Then lblName.Text = "Name" txtCity.Text = result.Properties("displayName")(0).ToString End If If (result.Properties.Contains("streetAddress")) Then lblAddress.Text = result.Properties("streetAddress")(0) End If If (result.Properties.Contains("l")) Then lblcity.Text = result.Properties("l")(0) End If If (result.Properties.Contains("st")) Then lblstate.Text = result.Properties("st")(0) End If If (result.Properties.Contains("postalCode")) Then lblzip.Text = result.Properties("postalCode")(0) End If If (result.Properties.Contains("physicalDeliveryOfficeName")) Then lblphone.Text = result.Properties("physicalDeliveryOfficeName")(0) End If If (result.Properties.Contains("mail")) Then lblDesc.Text = result.Properties("mail")(0) End If End If Catch Throw Finally If Not (entry Is Nothing) Then entry.Dispose() End If If Not (searcher Is Nothing) Then searcher.Dispose() End If End Try




Reply With Quote