This was a problem I had a while back. How do I get all the user profiles? For instance this customer wanted a specific filtering for the profiles list and a very special rendering of the results. So I had to get all the profiles and then programmatically filter the results. Anyway, the following code searches the userprofile list with the domain name as search string giving all profiles as a result.
//Get profile manager
SPServiceContext m_context = SPServiceContext.GetContext(SPContext.Current.Site);
UserProfileManager m_upm = new UserProfileManager(m_context);
//Search for all user profiles containing the current domain name which will return all profiles
rptProfiles.DataSource = m_upm.Search("MyDomainName");
rptProfiles.DataBind();
I later on changed the rendering to use an SPGridView but I’ll cover that in another post when I have it working flawlessly.