How to List of User Profile Properties in MOSS 2007

No.of Views2170
Bookmarked0 times
By  amalhashim   On  24 Oct 2010 01:10:46
Tag : SharePoint , Development and Programming
How to List of User Profile Properties in MOSS 2007
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at



Below is the code to enumerate the User Profile Properties.


using System;
using Microsoft.Office.Server;
using Microsoft.Office.Server.UserProfiles;
using Microsoft.SharePoint;

namespace ConsoleApplication1
{class Program
    {static void Main(string[] args)
        {using (SPSite site = new SPSite("http://server:port/"))
                ServerContext context = 
                UserProfileManager profileManager = new UserProfileManager(context);string sAccount = "domain\\user";
                UserProfile u = profileManager.GetUserProfile(sAccount);
                PropertyCollection props = profileManager.Properties;foreach (Property prop in props)
                    Console.WriteLine(prop.DisplayName + ">>" + prop.Name );

 Hope helps.thank you

Sign Up to vote for this article
About Author
Occupation-Software Engineer
Company-Aditi Technologies
Member Type-Senior
Location-Not Provided
Joined date-07 Jun 2009
Home Page-
Blog Page-
I have done my masters in Computer Applications and graduation in Computer Science. I have great passion in working with Microsoft tool and technologies. I am also a Microsoft Most Valuable Professional. Personally my objective is to design/develop applications which eases user experience and performs better in long run.
Other popularSectionarticles
There is no comments for this articles.
Leave a Reply
Display Name:
(not display in page for the security purphase)
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top