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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Get picture of a user programatically is not possible only after more hours after the picture was lo

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :SharePoint

Hello All,

I am trying to get the picture of a user programatically:

It goes like: 

UserProfileManager manager = new UserProfileManager(SPServiceContext.GetContext(site));

UserProfile profile = manager.GetUserProfile(currentUser.GetBinaryId());

string picUrl = userProfile["PictureUrl"].Value.ToString();

Now I mapped the picture property of the user profile to a property in the Active Directory. I uploaded a picture through the My Profile site of the user.  I ran the User Profile Synchronization and the User Profile Quick Synchronization jobs. I see that the picture is loaded into the My Settings page of the user too. BUT through the code I can not get the picture only after a min of 6-7 hours.

Why is this happening? Is there another job I should run or is this normal behaviour?



View Complete Post

More Related Resource Links

BDC Import for user profile picture

I am attempting to populate the user profile property 'Picture' with data from a BDC connection. My column from the BDC contains urls but SharePoint will not allow me to map Picture to the column. I"m guessing this is because the property is expecting a strongly typed Url type. That doesn't help me though. So, has anyone successfully mapped the Picture property to a field from a BDC connection. (-SN: I know the field can be mapped to AD but I need it mapped to a BDC) Thanks in advance.

User Profile Sync - Profile Picture Export to AD Problem

To start, I think I've read every post/blog/etc there is on this subject.  Currently I have user profile import to Sharepoint 2010 working.  It imports profile data just fine.  Everything in the FIM Synchronization manager show success even.  Its the export from Sharepoint to AD of the user profile picture that isn't working at all.  I've gone thru the steps of adding the thumbnailphoto export under the picture properties.  I can see the export inside of the FIM manager.  I notice though that in FIM there is there a DS_EXPORT of the objects.  I've looked into the SyncDB and noticed in the metaverse table the SPS_MV_OctetString_PictureURL never gets updated with the information from the PictureURL column of the ProfileDB.  It is always Null.  Actually in FIM it only shows one person with an update, and keep showing the PictureURL property as being not applied, which is probably because it is showing it as blank only.  In the connector for the object in FIM, I get the error that I've seen in some blog posts where it says PictureURL (String) is not compatible with SPS_MV_OctetString_PicutreURL (binary), but that seems to be how Sharepoint builds the connection even though FIM finds it invalid.  I've had that created, deleted several times, so I guess that is ordinary, and not sure that is even the problem.

Create a picture that can be marked by the user using drag and drop

I am trying to see if it's possible for me to have a picture like of a car and have it to where users are able to take a symbol and mark up the diagram with it.  Without needing a template pen.  Thanks for any help and advice.

User Profile Sync - Picture to thumbnailphoto export


Hi there,

I'm trying to get the staff pictures from My Sites to update the thumbnailphoto attribute in Active Directory.

I've setup the User Profile Sync, and I'm able to import and export to AD. However, I'm having a problem getting the Picture property to update the thumbnailphoto attribute. I can't find any errors, and it looks as though the sync is working to some extent because any previous information in thumbnailphoto is cleared after a sync.

If I look at what's going on in Forefront Identity Manager for 'DS_EXPORT', i can see that it has deleted the old value, and that the new value is empty.

Any suggestions are greatly appreciated!



how to import user Profile Picture already stored in AD as thumbnailphoto or jpegphoto


We already store out photos in AD using both the thumbnailsphoto and jpegphoto properties. Outlook2010 shows the user profile correctly. Now we want to sync sharepoint 2010 with AD and retreive the photo. I currenrlt have it setup as mentioned in this MSDN post to Export.


Is it odd that the thumbnailphoto and jpeg photo have been in AD since at least 2007( I think they were even in 2003 schema) but that this user profile syncing to those two atributes isn't the default behavour? Outlook 2010 used those photos instantly, yet sharepoint can't out of the box?


I've opened a Case with MS about this. I'll post findings here.

**Edit 2**

Also the previous method used in Moss 2007 doesn't work wither. Setting the URL to the photo in an AD ExtensionAttribute1 and having sharepoint import it.

User Profile Picture Mapping - Use existing SharePoint image library?


In SharePoint 2007 we did not use the Profile Pictures, but would like to start using them.  At the time, a consultant set up a separate picture library for the employee photos that was managed by the HR department.  Is it possible to somehow map the Profile Picture property to the images in this library?  Or do we have to upload them to each user's profile?  Our AD administrators do not know how to set AD up to use the URLs, so coming at it from that angle was a dead end.


How to create Word Verification where user type the characters see in the picture


Hi There:

I am not too sure what it call; however, I had seen many web site registration system had word verification (e.g gmail registration for new user) where user had to  type the characters see in the picture.

Anyone has idea how to implment this ? Or if there is tool our there can generate this as widget ? or AddOn components onto the ASP.Net page ?

Please advise.



Add Created By user picture in the Blog


I have SharePoint 2007 Blog Post page, I need to put the  Created By user picture from the user profile.  how to do this please. I used SharePoint designer 2007 to modify this page by using Data View option of Share Point designer.



I am new to sql

extract picture data from a string


dears,advance thanks.can anybdy help to solve my problem which is describing below.

Example- %%D1,100,0,0004[data...][0d0a]

Head - %%D1
Amount of data package -100
The data package No. - 0
Data Length -1024 (0004 (low bit in front, high bit in back) 0004= 0x0400=1024;)

data- Original Picture data -1024(maximum)
Tail -0x0d0a
Data in hex

from the above example i want to extract picture data and need to store in to the sql table.sql table columname is image and datatype is also image.after that i wanted to display this image column to an aspx page.

expecting help asap.

GridView does not show picture in row


OK, what is the problem here?

I do a gridview code that when displaying the information that come from the database is not showing any error at all, but is not displaying the right picture.

The problem,  I think, is that the (Eval("....") is not reading the values that are coming from the DataKeysNames. Due to this the right pictures are not displayed. But in another column, just for testing purposes I was able to display the values from DataKeysNames with the Eval. So I do not know what is going on and to make worse browser is not giving me any error.

So, this is the line that is not processing, reading or executing well:

ImageUrl='<%# IIF( (Eval("TUDTIWasItemUpgraded")) = "Yes",           string.Format("~/Images/ItemUpgradedTo.gif"),          string.Format("~/Images/ItemNoUpgradedYet.gif")    )       %>'     


And this is the complete code for the GridView



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:

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)

Issue With MOSS 2007 Picture library



We have a MOSS 2007 publishing portal. We are currently facing issues with Picture library created with default picture library template.Whenever we have tried to upload an image to the picture library I am getting "acess denied" error message, though I have full permission to the site level as well as to the library level.I have seen the pictures are getting uploaded and in "checked out" state.It does not show the "edit properties" page on upload and does not even allow the owner of the image to edit the properties, gives the same access denied error message.

I have also tried to check in the image files through the "management and content structure", but the images are not getting checked in. Please let me know the root cause of this and how we can resolve this.





how can I disable right click on the picture of website?

Hi Friends, Could you please recommend me a solution to disable right click on the pictures of website? thanks in advance , sepid  

picture data in database

I am creating a small application. I want to store picture in database. If i want to store pictures in database it will occupy lot of space in database. I want to keep folder to store picture. I want to store picture details and picture name in database. Plz tell the code. plz help me thanq.

Microsoft Office Picture manager is not launched in sharepoint 2010 picture library

Hi ? I am stuck up with :? Microsoft Office Picture manager is not launched in sharepoint 2010 picture library The description is : ? All the photos are stored in a picture library in the root of the My Sites called User Photos.? They are then stored in a folder called Profile Pictures. Navigate to your profile home page, delete default.aspx and type in ‘/user photos/’? (for example   ? But When I tried the edit option : Open Picture in a Picture Editor The page is blank : Microsoft Office Picture manager is not launched. ? Kindly help , if any service or step is missing. http://sp2010/my/user photos/).? This will take you to the root and then navigate to the folder Profile Pictures.http://sp2010/my/user photos/)

Multi-Line Picture Description with SlideShow Bug

If a photo has a multi-line description, then the silverlight slideshow will error out and not show pictures... Any ways around this... or a place to report bugs?

Speed Up Picture Library Slideshow transition?

I have a customer that's using the Picture Library Slideshow web part, but they want to speed up the transition time. I have to agree with them that the default fade in/fade out times are almost painful. Shouldn't both the transition type and time properties be exposed so an end user can adjust them? The only workaround I've seen for this is to use the Sliverlight Slideshow + container that's on Codeplex. Garth H MCITP BI 2008 MCTS: SQL 2005 & SharePoint 2010 http://bitinkering.spaces.live.com/
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