Your web.config has by default SqlProfile as default profile provider. This is of type System.Web.Profile.SqlProfileProvider and the only profile provider shipped with ASP .NET 2.0.
Therefore, accessing FirstName, LastName etc through the EPiServerProfile will not return a value. What you're looking for is a ProfileProvider for Active Directory. This is not part of EPiServer, neither shipped with ASP .NET 2.0, so you have to do some research (google is your best friend) in order to see if anybody has written a similar provider. See also:http://msdn2.microsoft.com/en-us/library/aa478953.aspx
Super, this works! Thanx
Now I still have to figure out how to get values for
Is it possible to get those fields hotwired to AD membership provider and thus avoid using DirectoryEntry and DirectorySearcher classes every time those values are needed?
No, you would have to build such a profileprovider yourself. The standard AD membership provider simply dont fetch attributes that doesnt exist on the default MembershipUser-class (which doesnt for example have a FirstName-property)
If you create your own AD membership/profile-providers you could channel their respectively needed attributes into one single AD-request thus saving some server roundtrips.
Thanx Johan. That one is clear.
Just one additional question. When such provider is created, does it end with mapping retrieved data to EpiServerProfile.Current? I would like to get full picture of that bridging provider to EpiserverProfile, if it's done that way.
Starting with EPiServerCMS 5 SP1 there is the option to have the profile all declared within the web.config (i.e. the dependency on profile to inherit from EPiServerProfileBase is removed), and by doing so, you can specify multiple profile providers that each takes care of parts of the total profile.
You can for example implement an ADProfileProvider that handles just the FirstName and LastName properties and leave all other properties handled by the SqlProfileProvider.
When creating your own profileprovider you implement GetPropertyValues() and SetPropertyValues(), which will be called with a collection of properties that are mapped to "your" provider. These methods are called by the framework, so you dont have to do any mapping to the helperclass EPiServerProfile yourself.