.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Read Mysite profile properties using C#.net

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :SharePoint
 
Hi, I want to read profile property of Mysites using C#.net.I written below code but it is throwing exception at third line of the code execution. Exception: Cannot complete this action. Please try again. SPSite site = new SPSite(strUrl);   // strUrl = I am mentioning MySite site collection URL here. Like ex: http://servername:1111/ ServerContext context = ServerContext.GetContext(site); UserProfileManager usrPrfMngr = new UserProfileManager(context);  //Exception occuring here foreach(UserProfile profile in usrPrfMngr) {      strEmail = profile["WorkEmail"].ToString(); } Please help me to resolve this issue. Thanks, -Gautham


View Complete Post


More Related Resource Links

Failed to read Mysite(hosted on port: 80) profile properties using Work flow

  

Hi,

I developed a sequential work flow to read My site profile properties. Which is working fine in development and test servers but not in production server.

My development and test server have my sites hosted on port number other than port 80. I am having no issues here working my code. I just pass my site URL to SPSite object...

SPSite site = new SPSite("http://developmentserver:5252/");

SPSite site = new SPSite("http://testserver:2383/");

Coming to the production server, I have my sites hosted on port 80. I change my sites URL to

SPSite site = new SPSite("http://mysites");

My work flow runs with out any error but it is not doing as it suppose to do. Think, it is not reading any profile properties. I am unable to debug the code as production server is 64 bit computer. I even changed my sites URL with complete domain name qualifying.

PSite site = new SPSite("http://mysites.domain.com");

Please help me to resolve this. I really appreciate your help!

 

Thanks,

-Gautham

 

 


How to read Sharepoint profile properties using C#.NET

  
Hi, I need to iterate through all the profiles existed in SharePoint and read the profiles property called "workemail". I followed below link, but no use. Getting error at "uniqueId" in the code. http://www.dotnetspider.com/resources/26399-How-access-SharePoint-User-Profile-from-C-code.aspx Tried below code as well SPSite site = new SPSite(strUrl);   // strUrl = I am mentioning MySite site collection URL here. Like ex: http://servername:1111/ ServerContext context = ServerContext.GetContext(site); UserProfileManager usrPrfMngr = new UserProfileManager(context);  foreach(UserProfile profile in usrPrfMngr) {      strEmail = profile["WorkEmail"].ToString(); } The above code is only reading the property of current logged on user. It is not iterating through all the profiles. After reading the current user property it is throwing an exception at foreach loop saying "Object reference is not set to an object" Any help would be appreciated. Thanks, -Gautham

Extended MySite: Profile picture uploading to the wrong zone.

  
I'm experiencing a problem where uploading a profile picture, in a MySite, uploads it to the wrong zone.

What I've done is created one web application and configured SSP to use that same one. As a result, the MySite host location is in that same web application:

Default Zone:
http://my.domain.com  <-- default SharePoint site.
http://my.domain.com/personal <-- MySite host

I then extended that web application to enable FBA & anonymous access:

Internet Zone:
http://extended.domain.com <-- extended default SharePoint site.

Now I"m able to navigate to a user's MySite using the extended URL (http://extended.domain.com/personal)...but when I upload a new profile picture in my MySite... it prompts me for new credentials because it's trying to upload to the Default zone (http://my.domain.com).

I found the following thread that talks about this...but there wasn't any resolution:
http://social.technet.microsoft.com/Forums/en-US/sharepointsocialcomputing/thread/ad6d96c2-0174-4603-9d9e-9d5018434259

What is the best practices when configuring a MySite in an extended web application? How can I fix the situation I'm encountering above?


P.S. I tried to change the MySite Host location (via SSP in the Central Administration)

Creating service application w/ Requirement for MySite security profile to be maintained

  
Good Day; In Sharepoint 2010 Microsoft has given the developer the ability to create a service application that can have its own database and scale independantly from the rest of the Sharepoint farm.   I wish to create a Service Application that will store data much like a list, but I need to have the ability to use the same security trimming that the profiles offer via MySites.  We need to have the granularity at a user level that we can get in MySites but I do not wish to store this data in the Mysite collections.  Can the security granularity found in Mysites and Profiles be extended into a Service Application?  Any examples of others doing this or case studies around security that I can be pointed to would be most helpful. Cheers C

Creating service application w/ Requirement for MySite security profile to be maintained

  
Good Day; In Sharepoint 2010 Microsoft has given the developer the ability to create a service application that can have its own database and scale independantly from the rest of the Sharepoint farm.   I wish to create a Service Application that will store data much like a list, but I need to have the ability to use the same security trimming that the profiles offer via MySites.  We need to have the granularity at a user level that we can get in MySites but I do not wish to store this data in the Mysite collections.  Can the security granularity found in Mysites and Profiles be extended into a Service Application?  Any examples of others doing this or case studies around security that I can be pointed to would be most helpful. Cheers C

Custom Control - Read Only Properties List

  
How would I add a (dropdown)  list of available values for a custom server control property?(Just like 'Visible' property of most controls has valid values of 'True/False' and nothing else can be entered or selected)

MySite user profile site creation of My Content page is created as provisioned failed (unprovisioned

  
I've been trying to troubleshoot our User Profile Sync and have noticed the profile pages weren't getting updated with everything.  Most content was but things like memberships and the content tabs weren't.  I also saw this error in ULS: ProfSynch: Exception attempting to enumerate site 25a72070-4249-4698-ae99-c2a45d25b08e for ContentDB 23a6e3ef-6d56-4bde-825e-95c6924e2f91: Microsoft.Office.Server.UserProfiles.ProfileSynchronizationInternalException: ProfSynch: The site with ID 25a72070-4249-4698-ae99-c2a45d25b08e cannot be synchronized due to an unprovisioned root web.      at Microsoft.Office.Server.UserProfiles.SiteSynchronizerCollection.GetSynchInfoForSite(SqlDataReader dr, SynchInfo info)      at Microsoft.Office.Server.UserProfiles.SiteSynchronizerCollection.<get_Elements>d__0.MoveNext() I checked in the MySite database under the webs table and noticed all the My Content sites for all of our users had the flag column with the number 1315 in them - (meaning unprovisioned as the error above states).  Cross checking with the User Sync Profile database under the SiteSynch table I noticed all of the sites have NULL for the value under both the LastSynch and ChangeToken columns (The User Profile Service Application - User Profile to SharePoint Full Synchronization  timer job takes care of populating that).&

Searching User Profile Properties

  

 

Hi all,

 

After a week of pulling my hair our and not reply's to my original posts. I’m giving it another crack to hopefully get some information to solve my problem.

 

Ill recap on what I'm trying to achieve.

 

Our HR department has a requirement that MySites must have a property for "Fire Warden", "First Aider" & "OHS Member".

 

I have successfully added these properties to MySite and they come up for every user and save state (as they are Boolean... checked or unchecked) no problem here what so ever.

 

Remove some of the properties in User profile

  

Hi,

In "Edit My profile" under my profile, there is a section called "Activities I am following:" under Newsfeed Settings, I want to remove either this section or some items in that activities list. But for some reason, "Activities I am following:"  is not found in the properties list, how I can remove it? Please advice.

Thanks in advance.


User Profile Properties

  

I am specifiying which user profile properties are to be displayed.

About five properties show at the top above 'More Information'.   There are descriptions for these  but these are not displayed, just the  value of the propetries.  How do I 1)  get the descriptions to show   2) determine which properties show here.

 


Privacy categories user profile properties

  

Hi

I would like to delete some privacy categories, used to display the user profile properties.

Default options are : only me, my manager, my team, my colleagues and everyone.
I only wish to display "only me" and "everyone".

How can I accomplish this?

TIA
Sjokke


Changed DNS, IIS mappings and AAM for mysite - "My News feed,profile,content" okay but MySite link s

  

Hi,

Sharepoint 2010 enterprise, I created a DNS entry and AAM for MySite - qnetmysite.company.local and all worked okay, then the customer wanted to change the URL used to access my site to "myqnet" so we deleted the DNS entry and recreated a new one. I changed the bindings in IIS and AAM to point to "myqnet.company.local". I can enter http://myqnet.company.local" and navigate to My News feed, My Profile, My content but when I try to navigate to MYSite the URL it takes me to is the old URL qnetmysite.company.local and internet explorer of course can't find the site. I have done an IIS reset, flushed the DNS on the local PC, when I mouse over the MySite link I can see the wrong URL.

Please can somebody help me?

 


Error messages on OOB properties in User Profile

  

Receiving error messages on OOB properties in User Profile thus unable to edit fields:

i.e. Skills field

Error Message: There was a problem retrieving data for this field. Updating values in this field is disabled temporarily. You can still update values in other fields.

The user profile service is started and we have provisioned a Metadata Service Application and associate it with the same web application we are using for the User Profile Application. We have also associated our MySites web application with the User Profile Service.

 


Mysite profile pictures not showing in people and groups, or search results

  
My organization is running MOSS 2007 Enterprise with search.  Picture profiles uploaded to the user's mysite only appear while browsing from the Default zone.  When browsing the Internet zone, a broken link appears in place of the picture when viewing pages such as "People and Groups" or search results.  For example:

Default zone:

http://moss1:5154   <---- mysite
http://moss1:5155   <---- main sharepoint site

Internet zone:

https://mysite.domain.com  <---- extended mysite
https://domain.com             <---- extended main sharepoint site

The picture profile url that is appearing while browsing the Internet zone is:

http://moss1:5154/personal/domain_jdoe/Shared%20Pictures/Profile%20Pictures/me_JPG.jpg

Instead of:

https://mysite.domain.com/personal/domain_jdoe/Shared%20Pictures/Profile%20Pictures/me_JPG.jpg

All of the textual information is coming over fine, just the images have invalid urls for the current zone.
Does anyone know how to fix this?

Any insights appreciated,

Eric


User Profile properties

  

Hi

I have a few user properties shown in the profile properties section of the user's profile page (under More Information), those information is in fact link that leads to a search. Is there a way to add those properties to the search scope automatically? As clicking on some of them return nothing (as the fields are not configured for search), or is there a way to remove the link and show text only?

Thanks in advance.


Need Clarifications on SharePoint 2010 User Profile properties and Sync database security

  

Need few clarifications on SharePoint 2010 user profile sync. I’ve answered some of them but need confirmation/clarity on this front.

  1. Is there option to disable ‘email address’ import from AD?
    Yes. Can disable that property mapping.
  2. Possible to send mails (user alerts) from SharePoint without the user profile property ‘email address’ mapped?
    Yes. User alert mails from SharePoint will work without ‘email address’ mapped in user profile DB.
  3. In case email address too is imported into SharePoint, can we bulk export them from SharePoint? If Yes, how to security harden that database?
    Not Sure. I believe Farm admin account/sync account has access to do this profile DB.

 Thanks in advance for your advice.<

Error updating MySite profile in sharepoint (MOSS) - An unknown user profile error has occurred. Tr

  

We come across an error stating "An unknown user profile error has occurred.  Try recreating this user profile or updating this user profile from the directory service to resolve this problem". 

This scenario is observed only for a particular account. The User has got 3 profiles with different accounts.

Problem seems to be only on Production server while on PreProduction & Test server its working fine. 

We have even tried deleting the user profile and recreate, but still the account is not accepting any profile changes. Also checked in the logs files but it didn't give any clue for the issue. 

Is there any specific reason for this behaviour? 

 

 

 

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend