Advertisement
Advertisement
| 03.31.2008 at 12:45PM PDT, ID: 23283724 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: |
Try
MsgBox("xLoginName = " & xLoginName)
xUserName = ExtractUserName(xLoginName)
MsgBox("xUserName=" & xUserName)
xDomainName = ExtractDomainName(xLoginName)
MsgBox("xDomainName=" & xDomainName)
Dim entryRoot As New DirectoryEntry("LDAP://" & xDomainName)
MsgBox("1.4")
Dim search As New DirectorySearcher(entryRoot)
MsgBox("1.5")
search.Filter = [String].Format("(SAMAccountName={0})", xUserName)
MsgBox("1.6")
search.PropertiesToLoad.Add("cn")
MsgBox("1.7")
search.PropertiesToLoad.Add("sn")
MsgBox("1.8")
search.PropertiesToLoad.Add("DisplayName")
MsgBox("1.9")
search.PropertiesToLoad.Add("dn")
MsgBox("1.10")
search.PropertiesToLoad.Add("sAMAccountName")
MsgBox("1.11")
search.PropertiesToLoad.Add("givenname")
MsgBox("1.12")
search.PropertiesToLoad.Add("ou")
MsgBox("1.13")
Try
Dim result As SearchResult = search.FindOne()
MsgBox("1.14")
'All MsgBoxs work as expected, except 1.14. I never see it. :(
|