Here is the code that worked for me...
Sub GetADUserInfo(ByVal user As String)
Dim idx1 As Integer
Dim idx2 As Integer
Dim searcher As New DirectorySearcher()
searcher.SearchRoot = New DirectoryEntry(domainADsPath, username, password)
searcher.Filter = "(sAMAccountName=" + user + ")"
searcher.SearchScope = SearchScope.Subtree
searcher.PropertiesToLoad.AddRange(New String() {"displayName", "department", "mail" })
Dim result As SearchResult
result = searcher.FindOne()
If Not (result Is Nothing) Then
Dim adCol As ICollection
Dim en As IEnumerator
adCol = result.Properties.Item("displayName")
en = adCol.GetEnumerator
While en.MoveNext
thisXDocument.DOM.selectSingleNode("//my:Name").text = en.Current
End While
adCol = result.Properties.Item("department")
en = adCol.GetEnumerator
While en.MoveNext
thisXDocument.DOM.selectSingleNode("//my:Department").text = en.Current
End While
adCol = result.Properties.Item("mail")
en = adCol.GetEnumerator
While en.MoveNext
thisXDocument.DOM.selectSingleNode("//my:EmailAddress").text = en.Current
End While
quote:
Originally posted by garym
I'm now receiving the following error
No mapping between account names and security IDs was done
The command that is producing the error is
objUser = GetObject("LDAP://" + objADSystemInfo.UserName)
Thanks
quote:
Originally posted by garym
There is a macro called IPFullTrust that allows you to test your form without having to install it on your computer. This at least resolves the short term problem of making changes and testing it. I will have to get Regform to work for the long term.
Thanks again!
quote:
Originally posted by K.Ramana Reddy
Hi,
Check this link,
you can get information about digital signatures,
http://office.microsoft.com/en-ca/assistance/HP010967151033.aspx
Thanks.