How to List of User Profile Properties in MOSS 2007

No.of Views2010
Bookmarked0 times
Downloads 
Votes0
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 info@codegain.com

 

Introduction

Below is the code to enumerate the User Profile Properties.

Code

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 = 
                ServerContext.GetContext(site);
                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
 
amalhashim
Occupation-Software Engineer
Company-Aditi Technologies
Member Type-Senior
Location-Not Provided
Joined date-07 Jun 2009
Home Page-http://lamahashim.blogspot.com
Blog Page-http://lamahashim.blogspot.com
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
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
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
</