Reputation: 1789
How can I access the current user information via LDAP and VB.Net 2.0*?
I found a vbscript that works, but I'd rather have it done in .net
Dim objSysInfo = CreateObject("ADSystemInfo")
Dim strUser = objSysInfo.UserName 'returns current user account
Dim objUser = GetObject("LDAP://" & strUser) 'queries active directory for user account
Any ideas out there? Because objUser.l makes less sense to me.
*I'm using the framework 2.0 because it is for more likely in my XP/Vista/7 World to have 2.0 installed than 3.5 or 4.0
Upvotes: 0
Views: 7733
Reputation: 1155
Take a look at http://www.dreamincode.net/forums/topic/30894-working-with-the-active-directory-in-vbnet/ or http://www.codeproject.com/Articles/19689/Working-with-Active-Directory-in-VB-NET
Upvotes: 1