The Art of SharePoint Evolution

Stories from a SharePoint Engineer that isn’t afraid of Visual Studio.

Importing User pictures from Active Directory to MOSS 2007

with 76 comments

In MOSS 2007 you’ll notice that users are able to upload pictures to there personal My Sites. These pictures also get propogated to the Contact Details web part as well as People Search Results.

So it’s actually a common practice for many companies to standardize on employee photos and disable everyone from uploading their glamour shots. To do this, first go to your Active Directory Management Console and hopefully you have the Exchange AD Management Plugin installed also.

You’ll know if you have it installed if you see all the tabs below:

1. Click on the Exchange Advanced Tab
2. Click Custom Attributes
3. Use one of those extensionAttribute values to store any kind of link to your picture.
4. OK out of AD.

Now you want to go to your MOSS Central Admin and do the following:

5. Go to your Shared Services Provider
6. Under User Profiles and My Sites click on User profiles and properties
7. Click on View Profile Properties at the bottom of the page.
8. Edit the Picture Property
9. Select “Do not allow users to edit values for this property”
10. In the Property Import Mapping Section change the Data source field to map: to your corresponding extensionAttribute# and hit OK.

Do a full user import and all the pictures should get populated into Sharepoint!

Written by Henry

February 21, 2007 at 10:54 am

Posted in SharePoint

76 Responses

Subscribe to comments with RSS.

  1. Thanks a lot for this simple idea! =)

    Alex

    March 1, 2007 at 7:48 pm

  2. You’re very welcome!

    Henry

    March 1, 2007 at 8:18 pm

  3. The pictures were imported into Sharepoint fine, however they can only be seen from the Sharepoint server. The path which I used was UNC.

    Any ideas?

    darthlawb

    March 8, 2007 at 9:53 am

  4. You’ll probably have to give everyone read access to that UNC path/folder.

    Henry

    March 8, 2007 at 1:20 pm

  5. They already do.

    The folder lives on a different server to the Sharepoint server, does that make a difference?

    darthlawb

    March 9, 2007 at 3:07 am

  6. It shouldn’t matter where that folder lives. One way to ensure the pictures show up is to store them within a picture library in sharepoint and then link to those in your AD attributes. That way, you can base the security trim off of your sharepoint permissions. You can also create a UNC path shortcut to a sharepoint library in case you wanted to make it simple stupid for whoever needs to update pictures.

    Henry

    March 9, 2007 at 9:02 am

  7. Hi Henry,
    I am a fellow sharepoint and was wondering if you would be interested in joing SharePoint Knowledge Network on Feedburner Network.
    http://networks.feedburner.com/just-sharepoint

    Just use contact form on my blog if you are keen.
    Cheers!
    Alpesh

    Alpesh Nakar

    March 12, 2007 at 4:29 am

  8. I used a UNC path but when I go to the My site the picture is not showing. Also when I click on the contact details and I edit that I can see the UNC path in the picture field but when I click on it, it looks for a file not the server where the picture is. So I get this “file://(UNC path)” and obviously I get page “cannot be displayed ” in the browser. What am i doing wrong?

    Isabelle

    March 12, 2007 at 5:19 am

  9. Put the folder into one of the IIS sites in the end so the pictures are available throug a HTTP path, this has done the trick.

    Cheers for the help.

    darthlawb

    March 12, 2007 at 7:24 am

  10. Hey Isabelle, I’m not sure what’s causing the problem in your environment but darthlawb has a good suggestion. Or you can try what I had previously mentioned – saving the pictures in a sharepoint library. That way you can just use the http://path to the picture in the attribute field.

    Henry

    March 12, 2007 at 11:04 am

  11. Great article, however I have run into a problem with this.

    When I try to change the “Property Import Mapping” section, there is only one listed “Master Connection”, for the “Source Data Connection” property. I can’t choose anything else.

    Any ideas on why this is the only option for me, and how I get a list of the AD properties to show up here?

    Thanks in advance…

    Richard

    March 14, 2007 at 12:39 pm

  12. Have you populated your user profile database yet? You might have to configure the user profile imports first. When you do that it’ll ask you which domain to import users from. This is also done on the SSP page.

    Henry

    March 14, 2007 at 6:12 pm

  13. Yes – all of my users are already imported – I didn’t have a problem getting this to work. Any other ideas?

    Richard

    March 14, 2007 at 7:30 pm

  14. Hey Richard, I re-read your original post and misunderstood it the first time. It’s the field below the field that contains “Master Connection” that you want to change. It’s called “Data source field to map:”

    Henry

    March 14, 2007 at 10:17 pm

  15. I’m having the same problem that Richard is having where all I have to choose from is “Master Connection” and nothing else. My screen does not show an additional field of “Data source field to map:” … any ideas?

    Shawn

    March 15, 2007 at 9:07 am

  16. As Shawn says, I don’t have a field called “Data Source field to map:”. The only drop down box that is shown is the one that contains “Master Connection”.

    I appreciate your assistance with this.

    Richard

    March 18, 2007 at 3:09 pm

  17. That’s odd… Sorry guys, I haven’t come across that scenario.

    Henry

    March 18, 2007 at 3:24 pm

  18. thanks anyway for putting some time into trying to solve this for us.

    Regards

    Richard

    Richard

    March 18, 2007 at 6:21 pm

  19. [...] Ong has three great walkthroughs that you must check out: how to Customize People Search Results, Importing User pictures from Active Directory to MOSS 2007 and How to Create Document Templates for Document [...]

  20. Can something like this be done in WSS 3.0???

    Nathan

    July 12, 2007 at 12:51 pm

  21. Not that I know of. I haven’t adminitered wss v3 much but I don’t think they have a user profile database accessable by its central admin.

    Henry

    July 12, 2007 at 3:02 pm

  22. If you were lacking the “Data source field to map” check out this site : http://paulhorsfall.co.uk/archive/2007/07/13/Unable-to-Configure-MOSS-Property-Import-Mappings.aspx

    Pete

    July 31, 2007 at 1:50 am

  23. Thanks for the tip Pete!

    Henry

    July 31, 2007 at 8:00 am

  24. No probs (as a complete newbie to SP it’s nice to be able to help)

    Another tip if you’re still having problems with not seeing “Data source field to map” is ….

    In : Shared Services Administration: SharedServices1 > User Profile and Properties > Configure Profile Import

    check that you’re actually using the “Specify Account” although for me the user was listed, the check was against “Use default Content Access Account”

    ** With thanks to JanW for spotting this

    Pete

    August 1, 2007 at 2:00 am

  25. Where the pictures must reside and where the location can be defined?

    Jack

    September 24, 2007 at 11:49 pm

  26. Jack, the picture can reside anywhere. The location where it can be defined is what this blog was about.

    Henry

    September 25, 2007 at 11:29 am

  27. Oh. Now I see. My bad. Read the article to quickly.
    Was wondering, because, in AD schema you have employeeid (hidden) which I store information. One solution of course would be that some script would generate that link for my AD to those extensionAttribute.
    I thought that the link information was generated on MOSS with some AD attribute, like employeeid to fullfill the picture info. But, this gave me a idea, with which I can currenlty live. thnx.

    Jack

    September 26, 2007 at 9:07 pm

  28. Henry, can you let me know how to save a photo for a user in AD?

    Joey

    October 24, 2007 at 6:14 am

  29. From reading the article again, looks like i will have to install Exchange AD Management Plugin in order for me to upload a photo of a user to AD, correct? Could anyone let me know where I can get this plug-in, is it free? Thanks!

    Joey

    October 25, 2007 at 12:09 am

  30. Henry

    October 25, 2007 at 7:51 am

  31. Hey Henry, looks like that method requires me install both Exchange and AD on the machine which is not easy for my case. Is there another way uploading a photo for a user? Actually, its nothing to do with Sharepoint, i am gonna try to get my application import the photos from AD.

    Appreciate your help! Thanks!

    Joey

    October 27, 2007 at 11:14 am

  32. Hey Joey, you don’t need to install exchange. You just need the disk to grab the tool off of it.

    Henry

    October 27, 2007 at 2:41 pm

  33. Hey Henry, Great Article. I was just wondering if the reverse was possible, i.e to create a user profile in A.D from MOSS basically from a form template that Users enter the F.Name, L.Name and so on into.

    Thanks

    US_

    November 9, 2007 at 12:17 pm

  34. Hey Usman, not out of the box. I know the DotNetFactory has some really cool web parts that enable you to manage AD from within SharePoint.

    Henry

    November 9, 2007 at 12:53 pm

  35. Hello,

    With exchange 2007, these tabs are being disabled again. Are there any other custom attibutes that we can user for this?

    Thanks

    Heine

    November 11, 2007 at 2:29 am

  36. Hey Heine,

    I haven’t tried this but I’m thinking you can map this property to a location within another data store as well. I’ll do a write up if I ever get a chance to look into it.

    Henry

    November 11, 2007 at 5:06 pm

  37. Hey Henry,

    I have installed Exchange AD Management Plugin, but the tabs still dont appear. I made sure the dll is registered mentioned at the following website. http://www.ramojha.com/exchange/Exchange_Tabs_missing.htm

    I also made sure IIS Manager is installed.

    Any suggestions on how to get the exchange tabs?

    Thanks!

    Joey

    November 12, 2007 at 8:13 am

  38. Henry, any word please?

    Joey

    November 22, 2007 at 12:28 pm

  39. Hey Joey, I noticed that they don’t show up if you’re using Vista. Are you using Vista or XP?

    Henry

    November 22, 2007 at 3:08 pm

  40. Hey Henry, I am using Win2K3 Server.

    Joey

    November 23, 2007 at 3:58 am

  41. Hi all

    Interesting post – couldn’t find much help outthere on the issue.

    My collegaues have already set things up pretty much as you describe on our client’s MOSS; profile import with pictures (residing in a SharePoint picture library) works great. However, when user use MOSS search to find collegaues, pictures first appear “cropped”, i.e. only showing upper left corner of the picture in the search results. Refreshing the page solves the problem, but it ain’t pretty when you first see the search results.

    Has anyone had a similar problem and any idea on where to tweak?

    Cheers

    Christian Lund

    December 6, 2007 at 4:52 am

  42. Hi Henry,

    I have got that working fine now, but i was wondering if there was a code of some sort I could user to put a variable on the end of it so I can just point it to a folder of pictures and it works out which pic is for which account.

    any help would be great

    Robert

    January 10, 2008 at 3:14 am

  43. Hey Robert, perhaps some kind of scripting can be used for filling out that attribute field. Like if the picture names were standardized to usernames, you can append the account’s username to the end of the string + .jpg or whatever? I’ve never tried this before so let us know if that’s even possible! :)

    Henry

    January 10, 2008 at 9:09 am

  44. Hi Henry, i have the picture on my profile :D but i nedd another manager field for the hirechy i dont know if i can do that. Can you help me??
    Thank you.

    Alexandra

    January 23, 2008 at 7:25 am

  45. Hey Alexandra, using the same concept of using the extensionAttributes, it’s possible to use another one of those fields to store a ‘dotted-line manager’. You’ll just have to make sure you update the profile import settings in the SSP to include that field. Let me know if you can’t find any information on that.

    Henry

    January 23, 2008 at 10:27 am

  46. All you guys being interested in how to manage user pictures should know about this:
    http://www.moss2007.be/blogs/vandest/archive/2007/07/24/profilepictureeventhandler.aspx
    I think it’s a great solution!

    Harald

    February 1, 2008 at 6:22 am

  47. [...] Import User pictures from Active Directory [...]

  48. Great article, Henry! I was wondering if it was possible to actually pull the photograph out of the Active Directory instead of just using a URL. AD will allow you to store a photo in the jpegPhoto attribute (as an octet string). I have a piece of software that allows a user to upload their photo to the Active Directory so I am curious if SharePoint 2007 could use this data instead of the path to the photo.

    Jim McBee

    March 3, 2008 at 12:46 am

  49. Hey Jim, I remember trying this a while back but didn’t see an import method that syncs the SharePoint user profile picture attribute with AD’s jpegPhoto octet string/binary blob. I could be wrong though.

    Henry

    March 3, 2008 at 2:05 pm

  50. Henry,
    How do you add the custom attribute to all domain users and not one by one?
    Thanks

    Eddie

    March 5, 2008 at 8:18 am

  51. Hey Eddie, I haven’t done this before but I’m quite sure it’s possible to script something for this.

    Henry

    March 7, 2008 at 6:40 pm

  52. Thanks Henry: My question relates to Eddie’s of 3/5. If the custom attribute was set to the same place in everyones AD info and each user had a corresponding location on their My Site, would all users then draw the photo to that location which was picked up on the profile import? Or am I missing something?

    Mike McCormack

    April 12, 2008 at 6:09 pm

  53. Hey Mike, I’m not sure if I understand your question, but I’ll give it a shot. The pictures will be displayed on their My Sites as long as the attribute is imported into the user profile database and if they point to each person’s unique picture url/file share address/etc.

    Henry

    April 14, 2008 at 8:03 pm

  54. I was trying to import user pictures from AD to MOSS 2007, but in the profile properties I dont have a picture property how do i make one
    thanks gill

    gillian

    April 18, 2008 at 1:00 am

  55. Just so you know the above blog was copied word for word from a pay support web site, I know because I was the one who wrote the above answer.

    Anyway, in answer to you question Gillian you can create a new user profile property by click new property at the top of your “view profiles property” page.

    The name should be picture
    The type should be URL
    At the bottom you can map it to your custom attribute you made in Exchange.

    ChrisB

    April 18, 2008 at 11:18 am

  56. Hey Chris, thanks for commenting but I disagree about this entry being a copied from another. Please send evidence, thanks!

    Henry

    April 18, 2008 at 12:42 pm

  57. Would love to show you but…
    1) it is on a pay site experts-exchange . COM
    2) this blog does not allow you to post URLs

    The text above is WORD for WORD and PUNCTUATION for PUNCTUATION that I wrote.

    ChrisB

    April 18, 2008 at 4:26 pm

  58. This blog does enable you to post links, see some comments above where others have done it.

    Must be a bizarre coincidence since i don’t even have a membership to experts-exchange. what was your posting date? and i’m sure it can’t be word for word, since i really wrote this myself on the date that it was published. are we twins? :)

    i was just searching around on expert’s exchange but couldn’t find anything related to this topic posted before 2/21/07. i’ve sent you my email to your gmail account. let’s chat about it and you can send me a link there.

    Henry

    April 18, 2008 at 5:03 pm

  59. In WSS 3.0 can I synch with AD users? I am not able to see SSP in the central adminstration of WSS 3.0. How can I create that?

    kalyan

    May 13, 2008 at 5:06 am

  60. If your picture is not shown, maybe it can be usefull to check a couple things in you html source of your site:

    when sharepoint shows the pictures the source will be like this:

    src=”file://server/folder$/picture.jpg”

    when it doens’t work it can be like this:

    src=”file:///folder$/picture.jpg”

    why? because you need to make you path absolute when you are linking the pictures to the active directory.

    Danovic

    June 16, 2008 at 6:11 am

  61. This doesn’t work with Exchange 2007.

    In AD, there is now a jpegPhoto attribute (though there is no interface to provide that information that I’ve found). Do you know of an application that will expose all the attributes in AD and allow for a user to modify the information… AKA… upload an image?

    paul

    July 28, 2008 at 11:56 am

  62. Hey Paul, I can confirm that the extension attributes are still there in an Exchange 2007 environment and that the jpegPhoto attribute existed before Exchange 2007. I know there’s a codeplex project out there somewhere that makes this process a little bit easier though.

    Henry

    July 28, 2008 at 5:57 pm

  63. We just finished developing MOSS as an upgrade to Sharepoint 2003. The old security groups for SharePoint were renamed to a new naming convention. However, the old names still show up in MOSS, but they are no longer shown when an AD query is run. Also, new groups creaed in AD are not shown either. For instance we have .r, .rx, .rxw, and .adm. For some reason only the .adm groups is displayed in MOSS. We don’t not use group nesting for any of the MOSS security groups.

    Any thoughts on how to remedy this?

    Carl

    July 29, 2008 at 12:05 pm

  64. Very helpful, Henry!

    thomassondergaard

    August 5, 2008 at 12:30 am

  65. Per some of the previous posts. You can not just install exchange admin tools and have the attributes. You have to have exchange. Exchange extends the schema of the active directory which addess the fields so that AD can be populated with the values. If you don’t have exchange already installed you will not be able to do this.

    Jeremy

    August 22, 2008 at 7:15 am

  66. Jeremy is right. Exchange must be installed or the tabs will not be visible. Anyone know an alternative way to import pictures?

    Ryan

    September 19, 2008 at 5:24 am

  67. Okay- got a weird one with Picture in Mysite. I uploaded a picture in MySite and when I open the MySite I can see the picture just fine. But when I go to People and Groups: All People on a site I see X on the Picture icon. I have been investigating this problem for a while. I can click on this x marked picture Icon that takes me to the User Information: User Name page where I can see user attributes.
    In the Picture attribute the picture Icon also come in x marked and clicking on it does not open the picture. I noticed when I hover over the pic it shows the URL of the pic which is http://site.Mysite.domain.com/personal/UserName/shared pictures/profile Pictures/user1.jpg
    But when i go to the properties of the pic it shows me the URL as http://site.Domain.com/personal/UserName/shared pictures/profile Pictures/user1.jpg

    Note it is missing the MYSite zone in the URL for some reason. And I thing this is what’s causing the pic not being displayed anywhere else except in the Mysite itself.

    I have checked in AD and MOSS to see where is coming from but no luck yet.

    Have anyone seen this behavior —

    Sorry for the long notes but thanks in advance for the help..

    Jaxy

    Jaxy

    September 22, 2008 at 12:52 pm

  68. I am seeing the same behavior that is described above by Christian Lund // December 6, 2007 at 4:52 am

    All of our pictures are working except for the fact that many times when a People search is performed the results appear cropped. Only the top left portion of the picture is displayed. After searching again or after a random number of screen refreshes the pictures become same sized in a thumbnail view.

    The pictures always look fine once the user clicks on the picture and it is viewed in the users My Site.

    Has anyone resolved this issue?
    Thanks
    Tony

    Tony

    October 9, 2008 at 11:21 am

  69. Hi Henry,

    I added a new field to the User Profile. Will I automatically see this new field in the site? or this needs to be imported? Please advise the best solution to see custom fields in the site. Thanks in advance.

    Josh

    November 9, 2008 at 2:38 pm

  70. sgs

    hi

    November 13, 2008 at 1:25 am

  71. If anyone is still having the AD mapping issue this worked for me: http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_23237475.html

    Michael

    December 2, 2008 at 5:19 am

  72. Hello Michael,

    I wish you are not trying to get promotion for Experts exchange. I love that site, but it will be great if you can provide the content of the URL “http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_23237475.html” here.

    Thanks.

    Praveen

    December 11, 2008 at 4:42 pm

  73. Hello to all,

    I’m trying to use the thumbnailpicture field from active directory. I have the images stored in this field. I’ve tried to link the field “Picture” in shared services and it gave me no result after full crawl.
    Any ideas, is thumbnailpicture not supported in Sharepoint 2007?

    Tks to all

    Pedro Oliveira

    January 5, 2009 at 6:26 am

  74. I’m sorry the active directory field is:

    thumbnailPhoto

    Tks to all

    Pedro Oliveira

    January 5, 2009 at 6:33 am

  75. I have the same issue as Pedro. I set the field to map to thumbnailPhoto and no images get imported.

    B B

    March 23, 2009 at 9:52 am

  76. [...] post by Henry initially helped me [...]


Leave a Reply