Hi All,
I have a form/app that users login to for trouble tickets. Below is the what the form/app uses to validate them.
code:
Private Function ValidateLogin( _
ByVal Username As String, _
ByVal Password As String, _
ByVal Domain As String) As Boolean
Dim token As IntPtr
' Call the API
If LogonUser(Username, _
Domain, _
Password, _
LOGON32_LOGON_NETWORK, _
LOGON32_PROVIDER_DEFAULT, token) = True Then
' Since the API returned TRUE, return TRUE to the caller
Return True
Else
' Bad credentials, return FALSE
Return False
End If
End Function
What I would like to do now is have it search AD for their email address and populate the fields in my form.
Code:
Populate Last, First (Manager_Text.text)
Populate email (director.text)
Any help out there??
I found this from dm4_ever which I think is close to what I need. I just need it to pass it over to my form..
Option Explicit
Dim objADSysInfo : Set objADSysInfo = CreateObject("ADSystemInfo")
Dim objUser : Set objUser = GetObject("LDAP://" & objADSysInfo.UserName)
WScript.Echo objUser.Mail
<message edited by Redtide001 on Monday, August 01, 2011 8:50 AM>