Jump to content

Paco

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Paco

  1. Up to me you can adapt the solution posted on the topic I have opened: or take directly the vi proposed on the answer #5 on this discussion if your purpose is just to validate the user: (Vi name is: Validate user name and password) best regards, Paco
  2. Hi Ned! Thank you very much, I have tested your VI and it's working perfectly :D I was not able to translate it in LabView code by myself thank you again
  3. Final solution was to do a dll with the below VB code and call it by labview. original code I found on neophob.com Dim adoLDAPCon, _ adoLDAPRS, _ strLDAP Public Function GetEmail(strAccountName As String, strDomainName As String) As String Set adoLDAPCon = CreateObject("ADODB.Connection") adoLDAPCon.Provider = "ADsDSOObject" adoLDAPCon.Open "ADSI" strLDAP = "'LDAP://" & strDomainName & "'" Set adoLDAPRS = adoLDAPCon.Execute("select mail from " & strLDAP & " WHERE objectClass = 'user'" & " And samAccountName = '" & strAccountName & "'") With adoLDAPRS If Not .EOF Then GetEmail = .Fields("mail") Else GetEmail = "" End If End With adoLDAPRS.Close Set adoLDAPRS = Nothing Set adoLDAPCon = Nothing End Function
  4. Deal All, I really hope that someone can help on it I would like, from a user name to get the corresponding e-mail address the idea is to provide to my VI: domain name user name eventually the password if really necessary and get as result the e-mail address. In attachment you can see what I already try by using the .NET System.DirectoryServices.AccountManagement but unfortunately as result I get an empty string If you have one alternative solution to query the Active Directory please let me know thank you in advance, best regards, Paco
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.