'Having Trouble retrieving "otherMobile" LDAP attribute vb.net
I am trying to retrieve "OtherMobile" attribute from AD. This is for an employee account recovery tool I am building. For some reason, I can't search on "otherMobile". Any ideas how? Thanks! my code:
Dim AD_entry As New DirectoryEntry("LDAP://", "username", "password",
AuthenticationTypes.Secure)
Dim objSearcher As New System.DirectoryServices.DirectorySearcher(AD_entry)
Dim search As New System.DirectoryServices.DirectorySearcher(AD_entry)
search.Filter = "(&(objectClass=user)(otherMobile=" + txtSearch.Text.Trim() + "))"
search.SearchScope = SearchScope.Subtree
search.PropertiesToLoad.Add("otherMobile")
Try
Dim result As SearchResult = search.FindOne()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|