VB.NET - Active Directory to find organizational unit for a user
Posted on 2010-08-19
I created a windows form application that create a record to a database. The application will get the window user's login name as the creator of that record. However, I also need to know where they're located. In Active Directory, we have organizational units for various users. Is there a way I can find out which organizational unit that user is from?
Here's my code to find out the username that is logged onto the machine:
Dim strUser as String = System.Environment.UserName
I need to find out which organizational unit this user is located within. Any ideas?