Hello! I am trying to update the logged on user's AD properties, but for some reason it is not updating. below is the Button sub routine. Any ideas would be great!! I am not getting any errors when I run it local, but nothing happens, no update. Protected Sub update_user_information(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sPath As String = "LDAP://" Dim dirEntry As New DirectoryEntry(sPath, "Admin", "Password") Dim dirSearcher As DirectorySearcher = New DirectorySearcher(dirEntry) dirSearcher.Filter = [String].Format("(SAMAccountName={0})", System.Environment.UserName) dirSearcher.SearchScope = SearchScope.Subtree dirSearcher.PropertiesToLoad.Add("cn") dirSearcher.PropertiesToLoad.Add("company") dirSearcher.PropertiesToLoad.Add("description") dirSearcher.PropertiesToLoad.Add("homePhone") dirSearcher.PropertiesToLoad.Add("department") dirSearcher.PropertiesToLoad.Add("mail") dirSearcher.PropertiesToLoad.Add("telephoneNumber") Dim searchResults As SearchResult = dirSearcher.FindOne() Dim dirEntryResults As New DirectoryEntry(searchResults.Path) If dep.Text <> "---" Then dirEntryResults.Properties("department").Add(dep.Text) End If 'If textbox_Office_Phone.Text <> "---" Then 'dirEntryResults.Properties("telephoneNumber").Add(textbox_Office_Phone.Text) 'End If dirEntryResults.CommitChanges() dirEntryResults.Close() End Sub
wrote:If dep.Text <> "---" Then
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)