I think this was posted in another thread as well. Anyway, you can write .NET managed code to do this or jscript code. There are several ways to do it in .NET code. One way is described in chapter 2 and by Scott in the other thread on this topic. The JScript way will require that you have a full trust form. You can also write a Active Directory web service to return this info and call the web service. We have a web service that does this and will be downloadable in the Downloads-Premium section. My recommendation would be to use .NET but that will require .NET framework, etc.
Good luck!
Patrick Halstead [InfoPath MVP]
InfoPathDev
Patrick Halstead
Project Manager at Qdabra