hey guys,
I have an webpage application that allows users to update their contact details and the result is updated in Outlooks Address book.
The code does the following:
Display a web app
Get the computer's current user name, and display the current users name on the webpage
User updates data on the webpage
Use Active Directory to update the LDAP fields
The results:
The app works on Windows 7 and an early build of Windows 10 laptop.
On a later build version of the Windows 10 laptop, the app displays errors ‘User details for <UserID> not found, which is from the applications sub PublicSub UpdateData()
The application is no longer able to Read/Write to AD/ LDAP.
I’m wondering if on the new Windows 10 build, a policy is ‘blocking/ or locking’ the application from reading and writing to AD/ LDAP. and what that maybe?
Any ideas as I need to provide the Win10 build guys information.
Ive attached the C# code, however I feel its image build related and not code related.
TIA
Public Shared Function FindUserID() As String
Return SecurityHelper.GetCurrentUserName().ToUpper()
End Function
Public Function GetData() As SearchResultCollection
Dim lDAPMgr As LdapManager = New LdapManager()
m_UserID = FindUserID()
m_LdapUserFilter = String.Format("(&(objectclass=user)(" & LdapUserNameKey & "={0}))", m_UserID)
Dim searchResultCollection As SearchResultCollection = Nothing
Try
searchResultCollection = lDAPMgr.DoSearch(New String() {}, m_LdapUserFilter)
Catch e As Exception
If searchResultCollection IsNot Nothing AndAlso searchResultCollection.Count = 0 Then
Throw New Exception(m_UserID.ToUpper() & " not found.", e)
Else
LogExceptionDetails(e)
End If
End Try
Return searchResultCollection
End Function
Public Sub UpdateData(ByVal bus As String, ByVal bus2 As String, ByVal fax As String, ByVal home As String, ByVal home2 As String, ByVal mob As String, ByVal pager As String, ByVal notes As String)
Dim ds As DirectorySearcher = New DirectorySearcher()
Dim de As DirectoryEntry = New DirectoryEntry()
Try
ds.Filter = m_LdapUserFilter
de.Path = ds.FindOne().Path
AssignPropertyValue(bus, ADProperties.Business, de)
AssignPropertyValue(bus2, ADProperties.Business2, de)
AssignPropertyValue(fax, ADProperties.Fax, de)
AssignPropertyValue(home, ADProperties.Home, de)
AssignPropertyValue(home2, ADProperties.Home2, de)
AssignPropertyValue(mob, ADProperties.Mobile, de)
AssignPropertyValue(pager, ADProperties.Pager, de)
AssignPropertyValue(notes, ADProperties.Notes, de)
de.CommitChanges()
Catch __unusedUnauthorizedAccessException1__ As UnauthorizedAccessException
Throw New Exception("Access denied.")
Catch e As Exception
LogExceptionDetails(e)
End Try
End Sub
Module ADProperties
Public Const Name As String = "name"
Public Const Desc As String = "description"
Public Const Title As String = "title"
Public Const Dept As String = "department"
Public Const Comp As String = "company"
Public Const Business As String = "telephonenumber"
Public Const Business2 As String = "othertelephone"
Public Const Fax As String = "facsimiletelephonenumber"
Public Const Home As String = "homephone"
Public Const Home2 As String = "otherhomephone"
Public Const Mobile As String = "mobile"
Public Const Pager As String = "pager"
Public Const Notes As String = "info"
End Module