2

Possible Duplicate:
How do I get the current logged in Active Directory username from VBA?

Is there any way to retrieve the user ID of the currently logged in user from Active Directory services using LDAP over an ADODB connection in VBA?

I have only seen examples of how to query additional information about a user by specifying the user name and password. In those examples the user name is generally retrieved using Environ("username"), but some of the users of my application log onto the network using a VPN, and their Windows user name may not be the same as the user name used to log onto the network via the VPN.

Thanks!

Community
  • 1
  • 1
Kuyenda
  • 4,529
  • 11
  • 46
  • 64
  • Here's a similar question: http://stackoverflow.com/questions/1043436/how-do-i-get-the-current-user-identity-for-a-vpn-user-in-a-windows-forms-app – Kuyenda Mar 01 '10 at 18:52
  • Whoops. Already asked this one. http://stackoverflow.com/questions/1574777/how-do-i-get-the-current-logged-in-active-directory-username-from-vba – Kuyenda Mar 01 '10 at 19:13

1 Answers1

1

EDITED: Active Directory by itself doesn't know if someone is logged in. There's no way you can do something like:

ActiveDirectory.getIsThisUserLoggedIn("username");

Active Directory only acts as a mechanism for user metadata, security, and authentication.

Alex Beardsley
  • 20,988
  • 15
  • 52
  • 67
  • Thanks for your response Nalandial. I did try going the VBA route, but haven't received any answers. http://stackoverflow.com/questions/1532343/how-to-query-cisco-vpn-state-and-username-from-vba and http://stackoverflow.com/questions/1574777/how-do-i-get-the-current-logged-in-active-directory-username-from-vba – Kuyenda Mar 01 '10 at 18:38
  • This is exactly what I needed to know: "Active Directory by itself doesn't know if someone is logged in." So the answer to this question is "No." – Kuyenda Mar 01 '10 at 19:04