jeudi 19 mars 2015

User Profiler : Property Not Defined: SPS-Section-BasicInfo



I'm trying to get all the properties for a user Profiler into Sharepoint. I'd like to know why the framework returns me this excepito. it seems like I must configure something with the USerProfiler. Has anybody any suggestion about that?



using (SPSite site = new SPSite(ConfigurationManager.AppSettings["server"]))
{
ServerContext context = ServerContext.GetContext(site);
UserProfileManager profileManager = new UserProfileManager(context,true);
ProfileSubtypePropertyManager pspm = profileManager.DefaultProfileSubtypeProperties;
foreach (UserProfile profile in profileManager)
{

foreach (ProfileSubtypeProperty prop in pspm.PropertiesWithSection)
{
//if (prop.IsSection)
// Console.WriteLine(prop.DisplayName); //this.Controls.Add(new Literal() { Text = string.Format("<tr><td colspan='3'><b>Section: {0}</b></td></tr>", prop.DisplayName) });
//else
//{
Console.WriteLine(string.Format(prop.DisplayName,
prop.Name,
profile[prop.Name].Value));


Property Not Defined: SPS-Section-BasicInfo. An administrator must create this property in the Profile Administration tool.








0 commentaires:

Enregistrer un commentaire