<p>I am trying to retrieve a user on Sharepoint's user photo through the WSS 3.0 object model. I have been browsing the web for solutions, but so far I've been unable to find a way to do it. Is it possible, and if so how?</p>

[{'answer_id': 61452, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>Ah, You have to use the UserProfileManager class.\nMore information here: <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.aspx</a></p>\n\n<p>Example use:</p>\n\n<pre><code>public override void ItemAdded(SPItemEventProperties properties)\n{\n    // Get list item on which the event occurred.\n    SPListItem item = properties.ListItem;\n\n    // Set the Author Image field to the user\'s PictureURL if it exists.\n    using (SPWeb web = properties.OpenWeb())\n    {\n        // Author: {C32DB804-FF2D-4656-A38A-B0394BA5C931}\n        SPFieldUserValue authorValue = new SPFieldUserValue(properties.OpenWeb(), item[new Guid("{C32DB804-FF2D-4656-A38A-B0394BA5C931}")].ToString());\n\n        UserProfileManager profileManager = new UserProfileManager(ServerContext.GetContext(web.Site));\n        UserProfile profile = profileManager.GetUserProfile(authorValue.LookupId);\n        UserProfileValueCollection values = profile[PropertyConstants.PictureUrl];\n\n        if (values.Count &gt; 0)\n        {\n            // Author Image: {37A5CA4C-7621-44d7-BF3B-583F742CE52F}\n            SPFieldUrlValue urlValue = new SPFieldUrlValue(values.Value.ToString());\n            item[new Guid("{37A5CA4C-7621-44d7-BF3B-583F742CE52F}")] = urlValue.Url;\n        }\n    }\n\n    item.Update();\n\n    // News Text: {7F55A8F0-4555-46BC-B24C-222240B862AF}\n    //\n\n    // Author Image: {37A5CA4C-7621-44d7-BF3B-583F742CE52F}\n    // \n\n    // Publish Date: {45E84B8B-E161-46C6-AD51-27A42E4992B5}\n    //\n}\n</code></pre>\n'}, {'answer_id': 61468, 'author': 'Eric Schoonover', 'author_id': 3957, 'author_profile': 'https://Stackoverflow.com/users/3957', 'pm_score': 4, 'selected': True, 'text': '<p>Here is a code snippet that should help get the job done for you.  You may need to do some additional validation to avoid any exceptions (ensuring the profile actually exists, ensuring the image URL actually exists, etc...):</p>\n\n<pre><code>    //get current profile manager\n    UserProfileManager objUserProfileManager = new UserProfileManager(PortalContext.Current);\n    //get current users profile\n    UserProfile profile = objUserProfileManager.GetUserProfile(true);\n    //get user image URL\n    string imageUrl = (string)profile[PropertyConstants.PictureUrl];\n\n    //do something here with imageUrl\n</code></pre>\n'}, {'answer_id': 79922, 'author': 'Sam Yates', 'author_id': 14911, 'author_profile': 'https://Stackoverflow.com/users/14911', 'pm_score': 2, 'selected': False, 'text': '<p>If you are strictly talking about WSS 3.0 (and not MOSS), then you really don\'t have global user profiles per se, but a hiddenh User Information List in each site collection. That mean none of the stuff in the Microsoft.Office.Server namespaces is available to you.</p>\n\n<p>However, you can update the User Information List programatically as long as you know the URL to a user\'s picture.  As long as you\'re running with some kind of elevated privileges, you should be able to <a href="http://www.sharepointblogs.com/jimyang/archive/2006/12/05/update-wss-3-0-user-profile-programmatically.aspx" rel="nofollow noreferrer">manipulate this list</a> just like you can with any other SharePoint list.  Keep in mind that this list is only good for the scope of a site collection, so users would have to make this same update all over the place to actually have a photo URL.  Plus users don\'t get into the User Information List until someone assigns some kind of permission to them, so not every user in your domain will be in there.</p>\n\n<p>The clean way to handle this is definitely the User Profile mechanism is MOSS, but if that\'s an option the question should really be updated to ask about MOSS vs WSS.</p>\n'}]
['https://Stackoverflow.com/questions/61339', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']