Very often in InfoPath, I need to query Active Directory for certain pieces of information just so that I can have some type of functionality within my forms. One of the most used and easiest forms of this is the user profile service. I use this to my advantage to query e-mail addresses, user account info, etc. Also, this is a must if you use the Contact Selector control from within InfoPath.
Follow these steps and you will be on your way. Stay tuned for part 2 as I will be showing how to query the display name for AD accounts in a later post.
GetUserProfileByName Data Connection