<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kraft Kennedy &#124; Technology Blog &#187; MySite</title>
	<atom:link href="http://blogs.kraftkennedy.com/index.php/tag/mysite/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.kraftkennedy.com</link>
	<description>Trends and insight into legal technology, infrastructure and strategic thinking.</description>
	<lastBuildDate>Wed, 14 Jul 2010 20:44:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Importing Employee Photos into MOSS 2007 MySites</title>
		<link>http://blogs.kraftkennedy.com/index.php/2009/12/25/importing-employee-photos-into-moss-2007-mysites/</link>
		<comments>http://blogs.kraftkennedy.com/index.php/2009/12/25/importing-employee-photos-into-moss-2007-mysites/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 14:36:10 +0000</pubDate>
		<dc:creator>Michael Fettner</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Enterprise Content Management]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[MySite]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blogs.kraftkennedy.com/?p=994</guid>
		<description><![CDATA[Most of the information in an employee&#8217;s MySite profile comes from the Active Directory profile import, which is set up in the SharePoint Shared Service Provider.  However, this can be tricky with employee photos since links to photos are not normally stored in Active Directory.  An easy way around this if you don&#8217;t want to store [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblogs.kraftkennedy.com%2Findex.php%2F2009%2F12%2F25%2Fimporting-employee-photos-into-moss-2007-mysites%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblogs.kraftkennedy.com%2Findex.php%2F2009%2F12%2F25%2Fimporting-employee-photos-into-moss-2007-mysites%2F" height="61" width="51" /></a></div><p>Most of the information in an employee&#8217;s MySite profile comes from the Active Directory profile import, which is set up in the SharePoint Shared Service Provider.  However, this can be tricky with employee photos since links to photos are not normally stored in Active Directory.  An easy way around this if you don&#8217;t want to store the links in Active Directory, is to simply create a picture library in SharePoint and upload all of the employee photos to the picture library with a standard name, such as username.jpg.  Then you can write a script to update each MySite profile and associate the photo with the person.<span id="more-994"></span></p>
<p>The code below is VB.Net code to interact with the SharePoint profile database by using the userprofilemanager class.  This will update one profile, so it would need to be put in a loop to update all of the employee profiles.</p>
<pre><span style="color: #ff0000">'Objects for profile database</span></pre>
<pre><span style="color: #ff0000">dim strUrl as string = &lt;site collection url&gt;</span></pre>
<pre><span style="color: #ff0000">dim site as Microsoft.SharePoint.SPSite = new SPSite(strUrl)</span></pre>
<pre><span style="color: #ff0000">dim sc as Microsoft.Office.Server.ServerContext = Microsoft.Office.Server.ServerContext.GetContext(site)</span></pre>
<pre><span style="color: #ff0000">dim upm as UserProfileManager = new UserProfileManager(sc)</span>
<pre><span style="color: #ff0000">dim sAccount as string = "domain\username"</span></pre>
<pre><span style="color: #ff0000">Dim u As UserProfile = upm.GetUserProfile(sAccount)        </span></pre>
<pre><span style="color: #ff0000">if u.ProfileManager.Properties.GetPropertyByName("PictureURL") is nothing then</span></pre>
<pre><span style="color: #ff0000"> 'error code</span></pre>
<pre><span style="color: #ff0000">else</span></pre>
<pre><span style="color: #ff0000"> u("PictureURL").Value = '&lt;put the url plus username.jpg here&gt;</span></pre>
<pre><span style="color: #ff0000"> u.Commit</span></pre>
<pre><span style="color: #ff0000">end if</span></pre>
<p>Remember to also include the following assembly and namespace...</p>
<pre><span style="color: #ff0000">&lt;%@ Assembly Name="Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;</span></pre>
<pre><span style="color: #ff0000">&lt;%@ Import Namespace="Microsoft.Office.Server.UserProfiles" %&gt;</span></pre>
<p>If you import additional fields into the profile store, it may be necessary to also run a complete profile import and an incremental search index process to make sure that everything is up to date.  Future profile imports won't overwrite the PictureURL property, so all employee photos should be permanent.  The only drawback is that you will have to run the script for new users or manually enter their picture URL.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.kraftkennedy.com/index.php/2009/12/25/importing-employee-photos-into-moss-2007-mysites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
