VB.Net Active Directory Username From user email

Posted on 2012-08-22
Last Modified: 2012-08-28
Hi to all,

I have a little application where I need to obtain a user’s active directory log on name where I only have his first name, last name and email address.

Can someone help me with the code to obtain that information?

Basically I need to loop through about 4000 records to load the active directory user name for each user based on the information listed above.

Question by:ALawrence007
    LVL 83

    Accepted Solution

    LVL 77

    Expert Comment

    by:David Johnson, CD, MVP
    curious as to why you need to search AD using information that you could have recieved from an email from that person. have them email you their samaccountname

    Author Comment

    When I can automate loading roughly 4000 records into SQL I would prefer that.

    Author Closing Comment

    Worked Great!

    Thanks CodeCruiser
    LVL 83

    Expert Comment

    Glad to help :-)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now