How do you get a profile picture?

How do you get the Profile Picture URL through code?

Burt at SharePoint Visit the source

Was this solution helpful to you?

Other answers

You can do something like this: public string GetUserPicture(SPSite site) { string userAccount = "domain\\account"; ServerContext ctx = ServerContext.GetContext(site); UserProfileManager upm = new UserProfileManager(ctx); UserProfile up = upm.GetUserProfile(userAccount); return up["PictureUrl"].Value; }

tarjeieo

do you need some kind of permissions to get the pictures of other users than yourself? I only get my own picture.

Gene Vangampelaere

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.