Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Private Function GetUserProperties() As ADProperties Dim ADName As String = GetLogonName() Dim bSuccess As Boolean = False Dim dirEntry As DirectoryEntry = GetDirectoryEntry() Dim dirSearcher As DirectorySearcher = New DirectorySearcher(dirEntry) Dim waitTime As TimeSpan = New TimeSpan(0, 0, 0, 5, 0) dirSearcher.ClientTimeout = waitTime dirSearcher.Filter = ("(samAccountName=" & ADName & ")") dirSearcher.PropertiesToLoad.Add("manager") dirSearcher.SearchScope = SearchScope.Subtree Try Dim dirResult As SearchResult = dirSearcher.FindOne() bSuccess = Not (dirResult Is Nothing) If dirResult.GetDirectoryEntry.Properties("manager").Value Is Nothing Then GetUserProperties.manager = "<Not Set>" Else GetUserProperties.manager = (dirResult.Properties("manager")(0).ToString()) End If bSuccess = True Catch ex As Exception bSuccess = False MsgBox("No Connection to the domain." & Environment.NewLine & "Please connect to corporate network & try again.", MsgBoxStyle.Critical, "Network Error #1") Application.Exit() End Try End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|ASP.net Moving Visual Studio 2015 project to 2017||2||68|
|Sending HTML Formatted Email from ASP.NET||2||55|
|Datagridview column resizing||8||26|
|Content of a read only textbox are not being saved in table in asp.net - VB||5||34|
Join the community of 500,000 technology professionals and ask your questions.