<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Adventures in SPWonderland. - WebParts</title>
    <link>http://blogs.flexnetconsult.co.uk/colinbyrne/</link>
    <description>Taking apart and putting back together</description>
    <language>en-us</language>
    <copyright>Colin Byrne</copyright>
    <lastBuildDate>Thu, 27 Mar 2008 08:42:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>webparts@flexnetconsult.co.uk</managingEditor>
    <webMaster>webparts@flexnetconsult.co.uk</webMaster>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=f1be83c7-0b1e-4704-9df3-31a306868451</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,f1be83c7-0b1e-4704-9df3-31a306868451.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,f1be83c7-0b1e-4704-9df3-31a306868451.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=f1be83c7-0b1e-4704-9df3-31a306868451</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm doing a <a href="http://suguk.org/forums/thread/8918.aspx">presentation tonight
for SUGUK</a> on Silverlight in sharePoint and wanted to demo some of the <a href="http://www.ssblueprints.net/sharepoint/">Silverlight
Blueprints for SharePoint</a>.
</p>
        <p>
Naturally I hit a few issues along the way so I thought I'd pass a few tips on. 
</p>
        <p>
A major requirement is to have .Net 3.5 and AJAX running on your SharePoint site.
If you configure AJAX by hand as I did check this <a href="http://msdn2.microsoft.com/en-us/library/bb861898.aspx">MSDN
article</a> for configuring AJAX but use 3.5.0.0 as the version number. 
</p>
        <p>
I configured AJAX by hand but there is also a <a href="http://www.codeplex.com/features " temp_href="http://www.codeplex.com/features ">CodePlex
feature</a> that can install AJAX on all your WFE.
</p>
        <p>
It will also help to have Visual Studio 2008 and the Silverlight SDk installed on
your dev box.
</p>
        <p>
The first issue is that none of the XAP's as shipped will work on my machine. You'll
get an error like this
</p>
        <p>
 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/SL Controls Error 2.JPG" border="0" />
        </p>
        <p>
 
</p>
        <p>
checking the XAP files shows the shipped one has this as the first line of the manifest.
</p>
        <p>
&lt;Deployment xmlns="<a href="http://schemas.microsoft.com/client/2007/deployment">http://schemas.microsoft.com/client/2007/deployment</a>"
xmlns:x="<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>"
EntryPointAssembly="SL.XAML.Navigation" EntryPointType="SL.XAML.Navigation.App"&gt;
</p>
        <p>
but if I recompile the source I get 
</p>
        <p>
&lt;Deployment xmlns="<a href="http://schemas.microsoft.com/client/2007/deployment">http://schemas.microsoft.com/client/2007/deployment</a>"
xmlns:x="<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>"
EntryPointAssembly="SL.XAML.Navigation" EntryPointType="SL.XAML.Navigation.App" RuntimeVersion="2.0.30226.2"&gt;
</p>
        <p>
The missing RuntimeVersion seems the key here, looks like the U2U folks were running
a slightly different build of chiron the XAP compiler and certainly the Silverlight
2 runtime on my machine wont run a XAP without it.
</p>
        <p>
So the fix is to recompile the Silverlight Applications and redeploy the XAP to the
ClientBin directory in your IIS website directory.
</p>
        <p>
Second and more bizarre is the Navigation Sample. If you try to run it you get an
error about being unable to load the Assembly. 
</p>
        <p>
The problem here is that the PublicKey for the SL.Controls.Navigation.Dll is wrong
in the MasterPage.
</p>
        <p>
 
</p>
        <p>
 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/SL Controls Error.GIF" border="0" />
        </p>
        <p>
The MasterPage has 4aec304184eb9a69 when the DLL has bb99f30c0098259c. 
</p>
        <p>
The Fix is to change the MasterPage Register TagPrefix line to bb99f30c0098259c. You
can use SharePoint Designer or uninstall the feature change it and then
reinstall, reactivate.
</p>
        <p>
This will happen when you dev with an internal snk file which has your company private
keys in it and then decide you've got to change it before you ship. I've done exactly
the same thing myself, it really helps to test it on a single machine outside your
company first.
</p>
        <p>
And IT LIVES
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/SSNavDemo.gif" border="0" />
        </p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=f1be83c7-0b1e-4704-9df3-31a306868451" />
      </body>
      <title>Fix: Getting the Silverlight Blueprints for SharePoint to work</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,f1be83c7-0b1e-4704-9df3-31a306868451.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/27/FixGettingTheSilverlightBlueprintsForSharePointToWork.aspx</link>
      <pubDate>Thu, 27 Mar 2008 08:42:00 GMT</pubDate>
      <description>&lt;p&gt;
I'm doing a &lt;a href="http://suguk.org/forums/thread/8918.aspx"&gt;presentation tonight
for SUGUK&lt;/a&gt;&amp;nbsp;on Silverlight in sharePoint and wanted to demo some of the &lt;a href="http://www.ssblueprints.net/sharepoint/"&gt;Silverlight
Blueprints for SharePoint&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Naturally I hit a few issues along the way so I thought I'd pass a few tips on. 
&lt;/p&gt;
&lt;p&gt;
A major requirement is to have .Net 3.5 and AJAX running on your SharePoint site.
If you configure AJAX by hand as I did check this &lt;a href="http://msdn2.microsoft.com/en-us/library/bb861898.aspx"&gt;MSDN
article&lt;/a&gt;&amp;nbsp;for configuring AJAX but use 3.5.0.0 as the version number. 
&lt;/p&gt;
&lt;p&gt;
I configured AJAX by hand but there is also a &lt;a href="http://www.codeplex.com/features " temp_href="http://www.codeplex.com/features "&gt;CodePlex
feature&lt;/a&gt; that can install AJAX on all your WFE.
&lt;/p&gt;
&lt;p&gt;
It will also help to have Visual Studio 2008 and the Silverlight SDk installed on
your dev box.
&lt;/p&gt;
&lt;p&gt;
The first issue is that none of the XAP's as shipped will work on my machine. You'll
get an error like this
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/SL Controls Error 2.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
checking the XAP files shows the shipped one has this as the first line of the manifest.
&lt;/p&gt;
&lt;p&gt;
&amp;lt;Deployment xmlns="&lt;a href="http://schemas.microsoft.com/client/2007/deployment"&gt;http://schemas.microsoft.com/client/2007/deployment&lt;/a&gt;"
xmlns:x="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt;"
EntryPointAssembly="SL.XAML.Navigation" EntryPointType="SL.XAML.Navigation.App"&amp;gt;
&lt;/p&gt;
&lt;p&gt;
but if I recompile the source I get 
&lt;/p&gt;
&lt;p&gt;
&amp;lt;Deployment xmlns="&lt;a href="http://schemas.microsoft.com/client/2007/deployment"&gt;http://schemas.microsoft.com/client/2007/deployment&lt;/a&gt;"
xmlns:x="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt;"
EntryPointAssembly="SL.XAML.Navigation" EntryPointType="SL.XAML.Navigation.App" RuntimeVersion="2.0.30226.2"&amp;gt;
&lt;/p&gt;
&lt;p&gt;
The missing RuntimeVersion seems the key here, looks like the U2U folks were running
a slightly different build of chiron the XAP compiler and certainly the Silverlight
2 runtime on my machine wont run a XAP without it.
&lt;/p&gt;
&lt;p&gt;
So the fix is to recompile the Silverlight Applications and redeploy the XAP to the
ClientBin directory in your&amp;nbsp;IIS website directory.
&lt;/p&gt;
&lt;p&gt;
Second and more bizarre is the Navigation Sample. If you try to run it you get an
error about being unable to load the Assembly. 
&lt;/p&gt;
&lt;p&gt;
The problem here is that the PublicKey for the SL.Controls.Navigation.Dll is wrong
in the MasterPage.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/SL Controls Error.GIF" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
The MasterPage has 4aec304184eb9a69 when the DLL has bb99f30c0098259c. 
&lt;/p&gt;
&lt;p&gt;
The Fix is to change the MasterPage Register TagPrefix line to bb99f30c0098259c.&amp;nbsp;You
can use SharePoint Designer or&amp;nbsp;uninstall the feature&amp;nbsp;change it and then
reinstall, reactivate.
&lt;/p&gt;
&lt;p&gt;
This will happen when you dev with an internal snk file which has your company private
keys in it and then decide you've got to change it before you ship. I've done exactly
the same thing myself, it really helps to test it on a single machine outside your
company first.
&lt;/p&gt;
&lt;p&gt;
And IT LIVES
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/SSNavDemo.gif" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=f1be83c7-0b1e-4704-9df3-31a306868451" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,f1be83c7-0b1e-4704-9df3-31a306868451.aspx</comments>
      <category>AJAX</category>
      <category>Bugs</category>
      <category>Sharepoint 2007</category>
      <category>Silverlight</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=e76c4e80-587b-46ac-891e-d08d9ab785bb</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,e76c4e80-587b-46ac-891e-d08d9ab785bb.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,e76c4e80-587b-46ac-891e-d08d9ab785bb.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=e76c4e80-587b-46ac-891e-d08d9ab785bb</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=9" target="_blank">Zach
Rosenfield</a> has a nice post on calling WebServices from PowerShell. The steps are
pretty simple: generate a proxy cs file, compile it into a DLL and then load that
DLL up into Powershell AppDomain. 
</p>
        <p>
Well I've been doing some work with quite a few of the WebServices and I wanted to
compile all the proxys into a single DLL. 
</p>
        <p>
Use Zach's post to setup the PowerShell environment variables needed to call the Visual
Studio SDK utilities wsdl.exe and csc.exe
</p>
        <p>
Heres the script to compile all the available SharePoint Webservice's into one DLL.
</p>
        <p>
It simply enumerates all the ASMX files in the ISAPI directory and passes each item
in that list to WSDL.exe which generates the proxy cs files.
</p>
        <p>
You need to change the URL in this script to point to a valid SharePoint site and
make sure there are no other .cs files in the directory before running this script.
</p>
        <div>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">$asmxlist= dir <span style="color: #006080">"C:\Program
Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI"</span> *.asmx
| select name $asmxlist | <span style="color: #0000ff">foreach</span>-object { write-host <span style="color: #006080">"Generating
SharePoint Proxy Library for $($_.name)"</span> -foregroundcolor green $outputfilename=<span style="color: #006080">"FlexnetConsult.SharePoint.$($_.name).cs"</span> $namespace=[IO.Path]::GetFileNameWithoutExtension($_.name)
wsdl <span style="color: #006080">"http://portal.contoso.com/matters/sites/_vti_bin/$($_.name)"</span> /o:$outputfilename
/namespace:$namespace } write-host <span style="color: #006080">"Compiling SharePoint
Proxy Library"</span> -foregroundcolor green csc /t:library /out:FlexnetConsult.SharePoint.WebServices.dll
*.cs </pre>
        </div>
        <p>
 
</p>
        <p>
So the output should be something like this
</p>
        <p>
 
</p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/image_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="447" alt="image" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/image_thumb.png" width="848" border="0" />
          </a>
        </p>
        <p>
 
</p>
        <p>
Now three of the WebServices generate an error SlideShow.asmx. FormserverProxy.asmx
and contentareatoolboxservice.asmx but as I'm unlikely to use them I'm not going to
worry about those.
</p>
        <p>
So now we have a DLL called FlexnetConsult.SharePoint.WebServices.dll in our directory
that we can use to call the (almost) any SharePoint Web Service. 
</p>
        <p>
I've attached the compiled dll and script.
</p>
        <p>
In my next post I'll use the DLL to do something I've wanted to do for ages and that's
list, add and delete Web Parts on a page using PowerShell. 
</p>
        <p>
Now your probably shouting, hey why not just call the object model and GetLimitedWebPartManager,
yep but that doesn't work as without a web.config and possibly a HttpContext all you
get back are Error WebParts as the WebPart safecontrollist cannot be accessed.
</p>
        <p>
  
</p>
        <div class="wlWriterSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:bdd73ff3-7ce5-4c77-b39b-9bf22a6af7b4" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
          <p>
            <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/GenerateSharePointProxyLibrary.ps1" target="_blank">GenerateSharePointProxyLibrary.ps1</a>
          </p>
        </div>
  
<p></p><div class="wlWriterSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:8a96d3f8-dfc2-4e58-b57b-54555752ee91" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"><p><a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/FlexnetConsult.SharePoint.WebServices.dll" target="_blank">FlexnetConsult.SharePoint.WebServices.dll</a></p></div><img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=e76c4e80-587b-46ac-891e-d08d9ab785bb" /></body>
      <title>PowerShell: Generating a proxy for all the SharePoint WebServices</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,e76c4e80-587b-46ac-891e-d08d9ab785bb.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/21/PowerShellGeneratingAProxyForAllTheSharePointWebServices.aspx</link>
      <pubDate>Fri, 21 Mar 2008 19:59:44 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=9" target="_blank"&gt;Zach
Rosenfield&lt;/a&gt; has a nice post on calling WebServices from PowerShell. The steps are
pretty simple: generate a proxy cs file, compile it into a DLL and then load that
DLL up into Powershell AppDomain. 
&lt;/p&gt;
&lt;p&gt;
Well I've been doing some work with quite a few of the WebServices and I wanted to
compile all the proxys into a single DLL. 
&lt;/p&gt;
&lt;p&gt;
Use Zach's post to setup the PowerShell environment variables needed to call the Visual
Studio SDK utilities wsdl.exe and csc.exe
&lt;/p&gt;
&lt;p&gt;
Heres the script to compile all the available SharePoint Webservice's into one DLL.
&lt;/p&gt;
&lt;p&gt;
It simply enumerates all the ASMX files in the ISAPI directory and passes each item
in that list to WSDL.exe which generates the proxy cs files.
&lt;/p&gt;
&lt;p&gt;
You need to change the URL in this script to point to a valid SharePoint site and
make sure there are no other .cs files in the directory before running this script.
&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;$asmxlist= dir &lt;span style="color: #006080"&gt;"C:\Program
Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI"&lt;/span&gt; *.asmx
| select name $asmxlist | &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;-object { write-host &lt;span style="color: #006080"&gt;"Generating
SharePoint Proxy Library for $($_.name)"&lt;/span&gt; -foregroundcolor green $outputfilename=&lt;span style="color: #006080"&gt;"FlexnetConsult.SharePoint.$($_.name).cs"&lt;/span&gt; $namespace=[IO.Path]::GetFileNameWithoutExtension($_.name)
wsdl &lt;span style="color: #006080"&gt;"http://portal.contoso.com/matters/sites/_vti_bin/$($_.name)"&lt;/span&gt; /o:$outputfilename
/namespace:$namespace } write-host &lt;span style="color: #006080"&gt;"Compiling SharePoint
Proxy Library"&lt;/span&gt; -foregroundcolor green csc /t:library /out:FlexnetConsult.SharePoint.WebServices.dll
*.cs &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
So the output should be something like this
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="447" alt="image" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/image_thumb.png" width="848" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Now three of the WebServices generate an error SlideShow.asmx. FormserverProxy.asmx
and contentareatoolboxservice.asmx but as I'm unlikely to use them I'm not going to
worry about those.
&lt;/p&gt;
&lt;p&gt;
So now we have a DLL called FlexnetConsult.SharePoint.WebServices.dll in our directory
that we can use to call the (almost) any SharePoint Web Service. 
&lt;/p&gt;
&lt;p&gt;
I've attached the compiled dll and script.
&lt;/p&gt;
&lt;p&gt;
In my next post I'll use the DLL to do something I've wanted to do for ages and that's
list, add and delete Web Parts on a page using PowerShell. 
&lt;/p&gt;
&lt;p&gt;
Now your probably shouting, hey why not just call the object model and GetLimitedWebPartManager,
yep but that doesn't work as without a web.config and possibly a HttpContext all you
get back are Error WebParts as the WebPart safecontrollist cannot be accessed.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp; 
&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:bdd73ff3-7ce5-4c77-b39b-9bf22a6af7b4" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/GenerateSharePointProxyLibrary.ps1" target="_blank"&gt;GenerateSharePointProxyLibrary.ps1&lt;/a&gt;
&lt;/p&gt;
&lt;/div&gt;
&amp;nbsp; 
&lt;p&gt;
&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:8a96d3f8-dfc2-4e58-b57b-54555752ee91" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/PowerShellGeneratingaproxyforalltheShare_11675/FlexnetConsult.SharePoint.WebServices.dll" target="_blank"&gt;FlexnetConsult.SharePoint.WebServices.dll&lt;/a&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=e76c4e80-587b-46ac-891e-d08d9ab785bb" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,e76c4e80-587b-46ac-891e-d08d9ab785bb.aspx</comments>
      <category>PowerShell</category>
      <category>Sharepoint 2007</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=abcb9261-2d42-40f7-bf58-5556c31e59cb</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=abcb9261-2d42-40f7-bf58-5556c31e59cb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm really stoked to be presenting at the UK SharePoint user group meeting in Basingstoke
on the 27 March about Silverlight and SharePoint.
</p>
        <p>
This presentation will explain what Silverlight is, what the benefits are over standard
web development and how Silverlight can be hosted in and integrate with SharePoint.<br />
With few slides and plenty of demos I'll walkthrough the creation of a Silverlight
2.0 video browser application that uses data from SharePoint and then deploy it to
SharePoint. I'll also show how a commercial Silverlight 2.0 product for SharePoint
is put together.
</p>
        <p>
The other presentations are 
</p>
        <p>
Architecting a Highly Available MOSS Farm - by Lewis Baldwin, ICS,  Head of Infrastructure
and Support 
</p>
        <p>
Governance: Protecting your SharePoint Investment by Symon Garfield, ICS,  SharePoint
Practice Lead
</p>
        <p>
The good folks at ICS solutions are hosting us at their offices in Basingstoke (<a title="http://www.icssolutions.co.uk/pages/howtofindus.aspx" href="http://www.icssolutions.co.uk/pages/howtofindus.aspx">http://www.icssolutions.co.uk/pages/howtofindus.aspx</a>).
</p>
        <p>
Just post a reply with your full name on this thread <a href="http://suguk.org/forums/thread/8918.aspx">http://suguk.org/forums/thread/8918.aspx</a> (registration
required)
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=abcb9261-2d42-40f7-bf58-5556c31e59cb" />
      </body>
      <title>Presenting SharePoint + Silverlight at the SharePoint UK UserGroup Basingstoke March 27th</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/11/PresentingSharePointSilverlightAtTheSharePointUKUserGroupBasingstokeMarch27th.aspx</link>
      <pubDate>Tue, 11 Mar 2008 13:06:22 GMT</pubDate>
      <description>&lt;p&gt;
I'm really stoked to be presenting at the UK SharePoint user group meeting in Basingstoke
on the 27 March about Silverlight and SharePoint.
&lt;/p&gt;
&lt;p&gt;
This presentation will explain what Silverlight is, what the benefits are over standard
web development and how Silverlight can be hosted in and integrate with SharePoint.&lt;br&gt;
With few slides and plenty of demos I'll walkthrough the creation of a Silverlight
2.0 video browser application that uses data from SharePoint and then deploy it to
SharePoint. I'll also show how a commercial Silverlight 2.0 product for SharePoint
is put together.
&lt;/p&gt;
&lt;p&gt;
The other presentations are 
&lt;/p&gt;
&lt;p&gt;
Architecting a Highly Available MOSS Farm - by Lewis Baldwin, ICS,&amp;nbsp; Head of Infrastructure
and Support 
&lt;p&gt;
Governance: Protecting your SharePoint Investment by Symon Garfield, ICS,&amp;nbsp; SharePoint
Practice Lead
&lt;/p&gt;
&lt;p&gt;
The good folks at ICS solutions are hosting us at their offices in Basingstoke (&lt;a title="http://www.icssolutions.co.uk/pages/howtofindus.aspx" href="http://www.icssolutions.co.uk/pages/howtofindus.aspx"&gt;http://www.icssolutions.co.uk/pages/howtofindus.aspx&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
Just post a reply with your full name on this thread &lt;a href="http://suguk.org/forums/thread/8918.aspx"&gt;http://suguk.org/forums/thread/8918.aspx&lt;/a&gt; (registration
required)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=abcb9261-2d42-40f7-bf58-5556c31e59cb" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</comments>
      <category>SharePoint</category>
      <category>Silverlight</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=cbad89bd-f36a-40dd-9750-ec69665b2504</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=cbad89bd-f36a-40dd-9750-ec69665b2504</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
 
</p>
        <p>
Following on from the work in my previous post where I set the users Picture property
in their profile the next step is to add a Contact Web Part to our imported publishing
pages. I’m using the default layout page to add the contact Web Part to, this page
has the Web Part Zones underneath the content fields but you could use another layout
that has a Web Part zones to the right of the content fields and of course you can
use SharePoint Designer to create your own layout formats and embed the Contact control
without using code. 
</p>
        <p>
This is how our publishing pages will look once we have added the Web Part to each
page
</p>
        <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture4.gif" atomicselection="true">
          <img height="539" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture_thumb2.gif" width="818" />
        </a>
        <p>
        </p>
        <p>
An interesting feature of a Publishing page is that it has a contact property
where you can assign user details to each page, you can either lookup the user from
the picker in which case the page will pull the users details from the profile database
or you can type in the details yourself.
</p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact3.gif" atomicselection="true">
            <img height="559" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact_thumb1.gif" width="819" />
          </a>
        </p>
        <p>
 
</p>
        <p>
The nice thing about the Contact Web Part is that once you have added it to a publishing
page it will automatically pull the picture and the users description (if set in the
Web Part) that has been assigned to the page from the profile database. 
</p>
        <p>
One bad thing about the part is you only get the choice to put the users name left
or right not top or bottom.
</p>
        <p>
So on to the code, I need a function that will take a site URL and then set the default
Publishing Page’s contact property and then add the Web Part to the page. 
</p>
        <p>
  
</p>
        <p>
 
</p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:78a7f32e-0503-478d-8d7b-5209d97a76b5" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
          <pre style="background-color:White;">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="color: #000000; ">#
Function: Add</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ContactWebPart
# Description: Adds the Contact User Web Part to a publishing page # Parameters: SiteURL </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; "> Server
relative URL of the Area # UserName </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; "> UserName
to show </span>
              <span style="color: #0000FF; ">as</span>
              <span style="color: #000000; "> the
contact </span>
              <span style="color: #0000FF; ">in</span>
              <span style="color: #000000; "> domain\user
format # # Requirements: Needs to have the System.Web assembly loaded # function Add</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ContactWebPart($SiteURL,
$UserName) { $comment </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">Contact
WebPart Added</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $site </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #0000FF; ">new</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #0000FF; ">object</span>
              <span style="color: #000000; "> Microsoft.sharePoint.SPSite($SiteURL)
$web</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$site.OpenWeb()
$user</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; "> $web.Users.get_item($UserName)
$pubweb </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; "> [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$defaultpage</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$pubweb.GetPublishingPages()[$pubweb.DefaultPage]
$defaultpage.CheckOut() # Set Contact </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">Setting
Contact on </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; "> $pubweb.url </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> to </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; "> $user.Name
$defaultpage.set_Contact($user) $defaultpage.Update() $webpartmanager</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$web.GetLimitedWebPartManager($defaultpage.Url,
[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) $webpart</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #0000FF; ">new</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #0000FF; ">object</span>
              <span style="color: #000000; "> Microsoft.SharePoint.Portal.WebControls.ContactFieldControl
$webpart.ChromeType</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">[System.Web.UI.WebControls.WebParts.PartChromeType]::TitleOnly;
$webpart.Title</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">Page
Contact</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $webpart.PicturePosition</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">[Microsoft.SharePoint.Portal.WebControls.PictureDirection]::Left
$webpart.IsDisplayJobTitle</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$</span>
              <span style="color: #0000FF; ">true</span>
              <span style="color: #000000; "> $webpart.IsDisplayPicture</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$</span>
              <span style="color: #0000FF; ">true</span>
              <span style="color: #000000; "> $webpartmanager.AddWebPart($webpart, </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">LeftColumnZone</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">, </span>
              <span style="color: #000000; ">0</span>
              <span style="color: #000000; ">); </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Checking
in page</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $defaultpage.CheckIn($comment)
# Publish </span>
              <span style="color: #0000FF; ">if</span>
              <span style="color: #000000; ">($defaultpage.listItem.ParentList.EnableMinorVersions </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">eq
$</span>
              <span style="color: #0000FF; ">true</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">and
$publishingPage.ListItem.File.MinorVersion </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ne </span>
              <span style="color: #000000; ">0</span>
              <span style="color: #000000; ">)
{ </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Publishing</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $defaultpage.listItem.File.Publish($comment)
} # If moderation </span>
              <span style="color: #0000FF; ">is</span>
              <span style="color: #000000; "> being
used handle the approval </span>
              <span style="color: #0000FF; ">if</span>
              <span style="color: #000000; "> ($defaultpage.listItem.ParentList.EnableModeration)
{ $modInformation </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; "> $defaultpage.listItem.ModerationInformation </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Moderation
on, Current Status: </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; "> $modInformation.Status
# Check </span>
              <span style="color: #0000FF; ">for</span>
              <span style="color: #000000; "> pending
approval </span>
              <span style="color: #0000FF; ">if</span>
              <span style="color: #000000; ">($modInformation.Status </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ne
[Microsoft.SharePoint.SPModerationStatusType]::Approved) { </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Approving</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $defaultpage.ListItem.File.Approve($comment)
} } # Clean up $pubweb.Close() $web.Close() $site.Close() } </span>
            </div>
          </pre>
        </div>
        <p>
 
</p>
        <p>
In this code we find the SPUser object for the given username and set the Contact
property of the PublishingPage to it. We then add the web Part using the new SPLimitedWebPartManager
class. Most of the code is concerned with checking the page out and back in and assumes
the page is not already checked out.
</p>
        <p>
An interesting line is 
</p>
        <p>
$defaultpage=$pubweb.GetPublishingPages()[$pubweb.DefaultPage] 
</p>
        <p>
I'm indexing into the collection return by GetPublishingPages because Powershell doesn't
support generics in the current version.
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=cbad89bd-f36a-40dd-9750-ec69665b2504" />
      </body>
      <title>SharePoint/PowerShell 8: The one with the Contact Web Part</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/02/10/SharePointPowerShell8TheOneWithTheContactWebPart.aspx</link>
      <pubDate>Sat, 10 Feb 2007 20:17:59 GMT</pubDate>
      <description>&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Following on from the work in my previous post where I set the users Picture property
in their profile the next step is to add a Contact Web Part to our imported publishing
pages. I’m using the default layout page to add the contact Web Part to, this page
has the Web Part Zones underneath the content fields but you could use another layout
that has a Web Part zones to the right of the content fields and of course you can
use SharePoint Designer to create your own layout formats and embed the Contact control
without using code. 
&lt;p&gt;
This is how our publishing pages will look once we have added the Web Part to each
page
&lt;/p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture4.gif" atomicselection="true"&gt;&lt;img height="539" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture_thumb2.gif" width="818"&gt;&lt;/a&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
An interesting feature&amp;nbsp;of a Publishing page is that it has a contact property
where you can assign user details to each page, you can either lookup the user from
the picker in which case the page will pull the users details from the profile database
or you can type in the details yourself.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact3.gif" atomicselection="true"&gt;&lt;img height="559" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact_thumb1.gif" width="819"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The nice thing about the Contact Web Part is that once you have added it to a publishing
page it will automatically pull the picture and the users description (if set in the
Web Part) that has been assigned to the page from the profile database. 
&lt;/p&gt;
&lt;p&gt;
One bad thing about the part is you only get the choice to put the users name left
or right not top or bottom.
&lt;/p&gt;
&lt;p&gt;
So on to the code, I need a function that will take a site URL and then set the default
Publishing Page’s contact property and then add the Web Part to the page. 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:78a7f32e-0503-478d-8d7b-5209d97a76b5" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;#
Function: Add&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ContactWebPart
# Description: Adds the Contact User Web Part to a publishing page # Parameters: SiteURL &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt; Server
relative URL of the Area # UserName &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt; UserName
to show &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;as&lt;/span&gt;&lt;span style="color: #000000; "&gt; the
contact &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;in&lt;/span&gt;&lt;span style="color: #000000; "&gt; domain\user
format # # Requirements: Needs to have the System.Web assembly loaded # function Add&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ContactWebPart($SiteURL,
$UserName) { $comment &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Contact
WebPart Added&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $site &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;object&lt;/span&gt;&lt;span style="color: #000000; "&gt; Microsoft.sharePoint.SPSite($SiteURL)
$web&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$site.OpenWeb()
$user&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; $web.Users.get_item($UserName)
$pubweb &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$defaultpage&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$pubweb.GetPublishingPages()[$pubweb.DefaultPage]
$defaultpage.CheckOut() # Set Contact &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Setting
Contact on &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; $pubweb.url &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; to &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; $user.Name
$defaultpage.set_Contact($user) $defaultpage.Update() $webpartmanager&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$web.GetLimitedWebPartManager($defaultpage.Url,
[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) $webpart&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;object&lt;/span&gt;&lt;span style="color: #000000; "&gt; Microsoft.SharePoint.Portal.WebControls.ContactFieldControl
$webpart.ChromeType&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;[System.Web.UI.WebControls.WebParts.PartChromeType]::TitleOnly;
$webpart.Title&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Page
Contact&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $webpart.PicturePosition&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;[Microsoft.SharePoint.Portal.WebControls.PictureDirection]::Left
$webpart.IsDisplayJobTitle&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt; $webpart.IsDisplayPicture&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt; $webpartmanager.AddWebPart($webpart, &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;LeftColumnZone&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;, &lt;/span&gt;&lt;span style="color: #000000; "&gt;0&lt;/span&gt;&lt;span style="color: #000000; "&gt;); &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Checking
in page&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.CheckIn($comment)
# Publish &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;($defaultpage.listItem.ParentList.EnableMinorVersions &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;eq
$&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;and
$publishingPage.ListItem.File.MinorVersion &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ne &lt;/span&gt;&lt;span style="color: #000000; "&gt;0&lt;/span&gt;&lt;span style="color: #000000; "&gt;)
{ &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Publishing&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.listItem.File.Publish($comment)
} # If moderation &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;is&lt;/span&gt;&lt;span style="color: #000000; "&gt; being
used handle the approval &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt; ($defaultpage.listItem.ParentList.EnableModeration)
{ $modInformation &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.listItem.ModerationInformation &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Moderation
on, Current Status: &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; $modInformation.Status
# Check &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;for&lt;/span&gt;&lt;span style="color: #000000; "&gt; pending
approval &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;($modInformation.Status &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ne
[Microsoft.SharePoint.SPModerationStatusType]::Approved) { &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Approving&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.ListItem.File.Approve($comment)
} } # Clean up $pubweb.Close() $web.Close() $site.Close() } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
In this code we find the SPUser object for the given username and set the Contact
property of the PublishingPage to it. We then add the web Part using the new SPLimitedWebPartManager
class. Most of the code is concerned with checking the page out and back in and assumes
the page is not already checked out.
&lt;/p&gt;
&lt;p&gt;
An interesting line is 
&lt;/p&gt;
&lt;p&gt;
$defaultpage=$pubweb.GetPublishingPages()[$pubweb.DefaultPage] 
&lt;p&gt;
I'm indexing into the collection return by GetPublishingPages because Powershell doesn't
support generics in the current version.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=cbad89bd-f36a-40dd-9750-ec69665b2504" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=a332015d-c5dc-4433-a0f3-247fd37b0b04</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=a332015d-c5dc-4433-a0f3-247fd37b0b04</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
Now we have the portal setup I want to add a Contact WebPart to each page but before
I can do that I have to add a picture for each user I have imported, in order to keep
this post a little shorter I’m only going to concentrate on using the UserProfile
API’s to set our picture for each user.<br />
(The Contact WebPart is MOSS WebPart that shows a users name and description and optionally
their picture)<br />
The field that we are going to set programmatically is accessed on the Users edit
profile page as Picture: 
</p>
        <p>
        </p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile%5B7%5D.gif" atomicselection="true">
            <img height="301" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile_thumb%5B5%5D.gif" width="700" />
          </a>
        </p>
        <p>
Once set this will display the picture on the user profile like this
</p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite%5B4%5D.gif" atomicselection="true">
            <img height="504" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite_thumb%5B2%5D.gif" width="660" />
          </a>
        </p>
        <p>
          <br />
To do this I need to revisit our User.csv import file and add an extra field that
gives the name of the JPG file that holds the users picture.<br />
I’m going to assume that the previous blog post <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx">Upload
a directory of files in 4 lines</a> has already uploaded the users picture to the
SiteCollectionImages picture library, in real life you’d probably use a separate picture
library. 
</p>
        <p>
          <br />
Ideally a profile import has occurred after we have added the users to Active Directory
and populated the SharePoint profile database. 
<br /></p>
        <p>
Now to set the Users Picture property we know to know the Property Name of the Picture
Field.<br />
To make this easy to find out here’s the first function for our toolbox Get-SPUserProfileConfigManager. 
<br />
This function returns a UserProfileConfigManager (<a href="http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)">http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)</a>,
note this is the new class that resides in the Microsoft.Office.Server namespace not
the v2 obsolete one that lives in Microsoft.sharePoint.Portal.UserProfiles.<br />
Also ignore the sample currently given in the MSDN documentation above, it won’t work
as it uses the old classes where you pass a PortalContext to the constructor whereas
the new version of the classes take a ServerContext object.
</p>
        <p>
 
</p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:f03c9c5a-cb1a-407f-b4a6-7b3d8391bdb7" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000"> #
Function: Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileConfigManager
# Description: </span>
              <span style="COLOR: #0000ff">return</span>
              <span style="COLOR: #000000"> a
UserProfileConfigManager </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> which </span>
              <span style="COLOR: #0000ff">is</span>
              <span style="COLOR: #000000"> used </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> management
of MOSS User Profiles # Parameters: PortalURL URL </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> the
Portal Site Collection # # function Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileConfigManager([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL)
{ # Need to </span>
              <span style="COLOR: #0000ff">get</span>
              <span style="COLOR: #000000"> a
PortalContext </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> # </span>
              <span style="COLOR: #0000ff">as</span>
              <span style="COLOR: #000000"> we </span>
              <span style="COLOR: #0000ff">do</span>
              <span style="COLOR: #000000"> not
have a HttpContext we need to source one the hard way $site</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.SharePoint.SPSite($PortalURL)
$servercontext</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileConfigManager </span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext)
}</span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
        </p>
        <p>
 
</p>
        <p>
Once we get the UserProfileConfigManager we can call GetProperties and list the internal
and display names for each profile property 
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:df4400ea-56bc-45b0-8597-9d03eebc6046" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: white">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">$cm</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #0000ff">get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">userprofileconfigmanager </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">http://sps:2828</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000"> $cm.getproperties() </span>
              <span style="COLOR: #000000">|</span>
              <span style="COLOR: #000000"> select
name, displayname Name DisplayName </span>
              <span style="COLOR: #000000">----</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">-----------</span>
              <span style="COLOR: #000000"> UserProfile_GUID
Id SID SID ADGuid Active Directory Id AccountName Account name FirstName First name
LastName Last name PreferredName Name WorkPhone Work phone Office Office Department
Department Title Title Manager Manager AboutMe About me PersonalSpace Personal site
PictureURL Picture UserName User name QuickLinks Quick links WebSite Web site PublicSiteRedirect
Public site redirect SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Dotted</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">line
Dotted</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">line
Manager SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Peers
Peers SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Responsibility
Responsibilities SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Skills
Skills SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">PastProjects
Past projects SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Interests
Interests SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">School
Schools SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SipAddress
SIP Address SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Birthday
Birthday SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">MySiteUpgrade
My Site Upgrade SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">DontSuggestList
Don</span>
              <span style="COLOR: #000000">'</span>
              <span style="COLOR: #000000">t Suggest
List </span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">ProxyAddresses
Proxy addresses SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">HireDate
Hire date SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">LastColleagueAdded
Last Colleague Added SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">OWAUrl
Outlook Web Access URL SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">ResourceSID
Resource Forest SID SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">ResourceAccountName
Resource Forest Account Name SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">MasterAccountName
Master Account Name Assistant Assistant WorkEmail Work e</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">mail
CellPhone Mobile phone Fax Fax HomePhone Home phone </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
So from this list I see that I need to set the PictureURL property, to get
a UserProfile we first need a UserProfileManager object: 
</p>
        <p>
        </p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:7c115796-d7b7-4db2-ba54-61b544e8f4f8" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">#
Function: Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPProfileManager
# Description: Return a UserProfileManager </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> which </span>
              <span style="COLOR: #0000ff">is</span>
              <span style="COLOR: #000000"> used </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> accessing
MOSS User Profiles # Parameters: PortalURL URL </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> the
Portal Site Collection # function Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPProfileManager([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL)
{ # Need to </span>
              <span style="COLOR: #0000ff">get</span>
              <span style="COLOR: #000000"> a
PortalContext </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> # </span>
              <span style="COLOR: #0000ff">as</span>
              <span style="COLOR: #000000"> we </span>
              <span style="COLOR: #0000ff">do</span>
              <span style="COLOR: #000000"> not
have a HttpContext we need to source one the hard way $site</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.SharePoint.SPSite($PortalURL)
$servercontext</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileManager </span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
} </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
And then a helper function Get-SPUserProfile to obtain the UserProfile object itself:
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:739dfb37-41ea-48a3-a4c5-22392daee3d5" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">#
Function: Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPUserProfile
# Description: Return a UserProfile </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000">, </span>
              <span style="COLOR: #0000ff">this</span>
              <span style="COLOR: #000000"> will
be created </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000"> it
does not exist # Parameters: PortalURL URL </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> the
Portal Site Collection # DomainUser UserName </span>
              <span style="COLOR: #0000ff">in</span>
              <span style="COLOR: #000000"> Domain\user
format function Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPUserProfile([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL,
[</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">] $DomainUser)
{ $upm</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000"> Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPProfileManager([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL) </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000"> ($upm.UserExists($DomainUser) </span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">eq
$</span>
              <span style="COLOR: #0000ff">false</span>
              <span style="COLOR: #000000">) {
$upm.CreateUserProfile($DomainUser) } $upm.GetUserProfile($DomainUser) } </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
        </p>
        <p>
Note that this function will create the UserProfile if it does not already exist. 
</p>
        <p>
Now we just need a function that makes it easy to set a single UserProfile property,
if you have multiple properties to set it would be best to do them all at once and
then call commit. 
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f7de37-2adb-4300-829c-38f405485c2e" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver; WORD-WRAP: break-word">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">#
Function: Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileProperty
# Description: Sets a property on a User Profile # Parameters: UserName [optional]
UserName </span>
              <span style="COLOR: #0000ff">in</span>
              <span style="COLOR: #000000"> Domain\user
format # PropertyName Property to </span>
              <span style="COLOR: #0000ff">set</span>
              <span style="COLOR: #000000"> #
PropertyValue Property Value to </span>
              <span style="COLOR: #0000ff">set</span>
              <span style="COLOR: #000000"> #
$UserProfile UserProfile </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000">, </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">using</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">this</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">in</span>
              <span style="COLOR: #000000"> a
loop </span>
              <span style="COLOR: #0000ff">this</span>
              <span style="COLOR: #000000"> should
be </span>
              <span style="COLOR: #0000ff">set</span>
              <span style="COLOR: #000000"> # function
Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileProperty([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$UserName,
[</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">] $PropertyName,
[</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">] $PropertyValue,
[Microsoft.Office.Server.UserProfiles.UserProfile] $UserProfile) { # If we are not
passed a UserProfile </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> then
create it # </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000"> ($UserProfile </span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">eq
$</span>
              <span style="COLOR: #0000ff">null</span>
              <span style="COLOR: #000000">) { $UserProfile </span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000"> Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPUserProfile($UserName)
} $UserProfile[$PropertyName].Value</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000"> $PropertyValue
$UserProfile.Commit() } </span>
            </div>
          </pre>
        </div>
        <p>
Note this function can either be called with a pre-created userProfile object or a
UserName. 
</p>
        <p>
Heres the updated Users.CSV with the Picture Field added at the end   
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:f7247e94-13f2-494c-825d-cb127082faeb" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">LoginName,
DisplayName, FirstName, LastName, Email, Picture brianb, Brian Ballack, Brian, Ballack,
brianb@contoso.com, cowner10.jpg walterf, Walter French, Walter, French, walterf@contoso.com,
cowner12.jpg </span>
            </div>
          </pre>
        </div>
        <p>
Now a function to tie this all together, it imports the CSV files, locates the user
profile by login name and updates the user’s Picture URL: 
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f8305b-c24e-46fc-96f9-efcdf8b8d407" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">function
Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserPictures([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]
$PortalURL, [</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]
$UserFile, [</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]
$Domain ) { Import</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Csv
$UserFile </span>
              <span style="COLOR: #000000">|</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">foreach</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> {
$name</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">$Domain </span>
              <span style="COLOR: #000000">+</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">\"
+ $_.LoginName; </span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000"> $fullURL</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">$PortalURL </span>
              <span style="COLOR: #000000">+</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">/</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">+</span>
              <span style="COLOR: #000000"> $_.Picture;
Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileProperty
$PortalURL $name </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">PictureURL</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000"> $fullURL
} } </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
 And you can make use of all of the above code by running this command:
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:15f42277-8809-43c7-8718-b1baf3e0fc66" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserPictures </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">http://sps:2828</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">users.csv</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">contoso</span>
              <span style="COLOR: #000000">"</span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
Ok now we're all set to add the Contact WebPart to each publishing page in the next
post. 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a332015d-c5dc-4433-a0f3-247fd37b0b04" />
      </body>
      <title>SharePoint/PowerShell 7: Put the User in the Picture</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/01/28/SharePointPowerShell7PutTheUserInThePicture.aspx</link>
      <pubDate>Sun, 28 Jan 2007 18:24:37 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Now we have the portal setup I want to add a Contact WebPart to each page but before
I can do that I have to add a picture for each user I have imported, in order to keep
this post a little shorter I’m only going to concentrate on using the UserProfile
API’s to set our picture for each user.&lt;br&gt;
(The Contact WebPart is MOSS WebPart that shows a users name and description and optionally
their picture)&lt;br&gt;
The field that we are going to set programmatically is accessed on the Users edit
profile page as Picture: 
&lt;p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile%5B7%5D.gif" atomicselection="true"&gt;&lt;img height=301 src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile_thumb%5B5%5D.gif" width=700&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Once set this will display the picture on the user profile like this
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite%5B4%5D.gif" atomicselection="true"&gt;&lt;img height=504 src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite_thumb%5B2%5D.gif" width=660&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
To do this I need to revisit our User.csv import file and add an extra field that
gives the name of the JPG file that holds the users picture.&lt;br&gt;
I’m going to assume that the previous blog post &lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx"&gt;Upload
a directory of files in 4 lines&lt;/a&gt; has already uploaded the users picture to the
SiteCollectionImages picture library, in real life you’d probably use a separate picture
library. 
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
Ideally a profile import has occurred after we have added the users to Active Directory
and populated the SharePoint profile database. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Now to set the Users Picture property we know to know the Property Name of the Picture
Field.&lt;br&gt;
To make this easy to find out here’s the first function for our toolbox Get-SPUserProfileConfigManager. 
&lt;br&gt;
This function returns a UserProfileConfigManager (&lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)"&gt;http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)&lt;/a&gt;,
note this is the new class that resides in the Microsoft.Office.Server namespace not
the v2 obsolete one that lives in Microsoft.sharePoint.Portal.UserProfiles.&lt;br&gt;
Also ignore the sample currently given in the MSDN documentation above, it won’t work
as it uses the old classes where you pass a PortalContext to the constructor whereas
the new version of the classes take a ServerContext object.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:f03c9c5a-cb1a-407f-b4a6-7b3d8391bdb7 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt; #
Function: Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileConfigManager
# Description: &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
UserProfileConfigManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; which &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;is&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; used &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; management
of MOSS User Profiles # Parameters: PortalURL URL &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; the
Portal Site Collection # # function Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileConfigManager([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL)
{ # Need to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
PortalContext &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; # &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;as&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; we &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;do&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; not
have a HttpContext we need to source one the hard way $site&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.SharePoint.SPSite($PortalURL)
$servercontext&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileConfigManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext)
}&lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Once we get the UserProfileConfigManager we can call GetProperties and list the internal
and display names for each profile property 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:df4400ea-56bc-45b0-8597-9d03eebc6046 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;$cm&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;userprofileconfigmanager &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;http://sps:2828&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $cm.getproperties() &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;|&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; select
name, displayname Name DisplayName &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;----&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-----------&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; UserProfile_GUID
Id SID SID ADGuid Active Directory Id AccountName Account name FirstName First name
LastName Last name PreferredName Name WorkPhone Work phone Office Office Department
Department Title Title Manager Manager AboutMe About me PersonalSpace Personal site
PictureURL Picture UserName User name QuickLinks Quick links WebSite Web site PublicSiteRedirect
Public site redirect SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Dotted&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;line
Dotted&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;line
Manager SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Peers
Peers SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Responsibility
Responsibilities SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Skills
Skills SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;PastProjects
Past projects SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Interests
Interests SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;School
Schools SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SipAddress
SIP Address SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Birthday
Birthday SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;MySiteUpgrade
My Site Upgrade SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;DontSuggestList
Don&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;'&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;t Suggest
List &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;ProxyAddresses
Proxy addresses SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;HireDate
Hire date SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;LastColleagueAdded
Last Colleague Added SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;OWAUrl
Outlook Web Access URL SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;ResourceSID
Resource Forest SID SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;ResourceAccountName
Resource Forest Account Name SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;MasterAccountName
Master Account Name Assistant Assistant WorkEmail Work e&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;mail
CellPhone Mobile phone Fax Fax HomePhone Home phone &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
So from this list I&amp;nbsp;see that I&amp;nbsp;need to set the PictureURL property, to get
a UserProfile we first need a UserProfileManager object: 
&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:7c115796-d7b7-4db2-ba54-61b544e8f4f8 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;#
Function: Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPProfileManager
# Description: Return a UserProfileManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; which &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;is&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; used &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; accessing
MOSS User Profiles # Parameters: PortalURL URL &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; the
Portal Site Collection # function Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPProfileManager([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL)
{ # Need to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
PortalContext &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; # &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;as&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; we &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;do&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; not
have a HttpContext we need to source one the hard way $site&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.SharePoint.SPSite($PortalURL)
$servercontext&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
} &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
And then a helper function Get-SPUserProfile to obtain the UserProfile object itself:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:739dfb37-41ea-48a3-a4c5-22392daee3d5 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;#
Function: Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPUserProfile
# Description: Return a UserProfile &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;this&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; will
be created &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; it
does not exist # Parameters: PortalURL URL &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; the
Portal Site Collection # DomainUser UserName &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Domain\user
format function Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPUserProfile([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL,
[&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;] $DomainUser)
{ $upm&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPProfileManager([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL) &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ($upm.UserExists($DomainUser) &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;eq
$&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;false&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;) {
$upm.CreateUserProfile($DomainUser) } $upm.GetUserProfile($DomainUser) } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Note that this function will create the UserProfile if it does not already exist. 
&lt;/p&gt;
&lt;p&gt;
Now we just need a function that makes it easy to set a single UserProfile property,
if you have multiple properties to set it would be best to do them all at once and
then call commit. 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f7de37-2adb-4300-829c-38f405485c2e contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver; WORD-WRAP: break-word"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;#
Function: Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileProperty
# Description: Sets a property on a User Profile # Parameters: UserName [optional]
UserName &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Domain\user
format # PropertyName Property to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; #
PropertyValue Property Value to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; #
$UserProfile UserProfile &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;this&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
loop &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;this&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; should
be &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; # function
Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileProperty([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$UserName,
[&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;] $PropertyName,
[&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;] $PropertyValue,
[Microsoft.Office.Server.UserProfiles.UserProfile] $UserProfile) { # If we are not
passed a UserProfile &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; then
create it # &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ($UserProfile &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;eq
$&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;null&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;) { $UserProfile &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPUserProfile($UserName)
} $UserProfile[$PropertyName].Value&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $PropertyValue
$UserProfile.Commit() } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Note this function can either be called with a pre-created userProfile object or a
UserName. 
&lt;p&gt;
Heres the updated Users.CSV with the Picture Field added at the end&amp;nbsp;&amp;nbsp; 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:f7247e94-13f2-494c-825d-cb127082faeb contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;LoginName,
DisplayName, FirstName, LastName, Email, Picture brianb, Brian Ballack, Brian, Ballack,
brianb@contoso.com, cowner10.jpg walterf, Walter French, Walter, French, walterf@contoso.com,
cowner12.jpg &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Now a function to tie this all together, it imports the CSV files, locates the user
profile by login name and updates the user’s Picture URL: 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f8305b-c24e-46fc-96f9-efcdf8b8d407 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;function
Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserPictures([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]
$PortalURL, [&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]
$UserFile, [&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]
$Domain ) { Import&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Csv
$UserFile &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;|&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;foreach&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; {
$name&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;$Domain &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;+&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;\"
+ $_.LoginName; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $fullURL&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;$PortalURL &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;+&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;/&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;+&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $_.Picture;
Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileProperty
$PortalURL $name &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;PictureURL&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $fullURL
} } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;And you can make use of all of the above code by running this command:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:15f42277-8809-43c7-8718-b1baf3e0fc66 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserPictures &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;http://sps:2828&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;users.csv&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;contoso&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Ok now we're all set to add the Contact WebPart to each publishing page in the next
post. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a332015d-c5dc-4433-a0f3-247fd37b0b04" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=457e5ce4-4673-456a-9a24-c72145acd57b</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=457e5ce4-4673-456a-9a24-c72145acd57b</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Flexnet Consultants have just released a brand new free Web Part. 
</p>
        <p>
The PhotoGrid WebPart will show a nXn grid of Picture Library images with a each image
randomly chosen to be enlarged. This is similar to the Flikr Photobadge.
</p>
        <p>
You can set the number of pictures on each row and the number of rows along with the
time the enlarged picture is displayed (Display time). 
</p>
        <p>
Our Web Parts page uses a Flash embedded demo to show you how it would look.
</p>
        <p>
          <a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm">http://www.flexnetconsult.co.uk/WebParts/WebParts.htm</a>
        </p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=457e5ce4-4673-456a-9a24-c72145acd57b" />
      </body>
      <title>New Free Web Part: Flash Dynamic PhotoGrid </title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/04/02/NewFreeWebPartFlashDynamicPhotoGrid.aspx</link>
      <pubDate>Sun, 02 Apr 2006 17:49:45 GMT</pubDate>
      <description>&lt;p&gt;
Flexnet Consultants have just released a brand new free Web Part. 
&lt;/p&gt;
&lt;p&gt;
The PhotoGrid WebPart will show a nXn grid of Picture Library images with a each image
randomly chosen to be enlarged. This is similar to the Flikr Photobadge.
&lt;/p&gt;
&lt;p&gt;
You can set the number of pictures on each row and the number of rows along with the
time the enlarged picture is displayed (Display time). 
&lt;/p&gt;
&lt;p&gt;
Our Web Parts page uses a Flash embedded demo to show you how it would look.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm"&gt;http://www.flexnetconsult.co.uk/WebParts/WebParts.htm&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=457e5ce4-4673-456a-9a24-c72145acd57b" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</comments>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=0b75dd93-971f-48f1-b572-8e871668b53d</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=0b75dd93-971f-48f1-b572-8e871668b53d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Version 1.2 of our free Flash Slideshow Web Part is released.
</p>
        <p>
The Slideshow Web Part will show a rotating display of all the pictures in the Picture
Library with an adjustable fade transition between each picture. 
</p>
        <p>
This version has better support for SharePoint sites running on non standard http
ports.
</p>
        <p>
It now also supports all the image formats that the Picture Library does.
</p>
        <p>
          <a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm">http://www.flexnetconsult.co.uk/WebParts/WebParts.htm</a>
        </p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b75dd93-971f-48f1-b572-8e871668b53d" />
      </body>
      <title>Flash Slideshow Web Part Version 1.2 released</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/04/02/FlashSlideshowWebPartVersion12Released.aspx</link>
      <pubDate>Sun, 02 Apr 2006 17:43:48 GMT</pubDate>
      <description>&lt;p&gt;
Version 1.2 of our free Flash Slideshow Web Part is released.
&lt;/p&gt;
&lt;p&gt;
The Slideshow Web Part will show a rotating display of all the pictures in the Picture
Library with an adjustable fade transition between each picture. 
&lt;/p&gt;
&lt;p&gt;
This version has better support for SharePoint sites running on non standard http
ports.
&lt;/p&gt;
&lt;p&gt;
It now also supports all the image formats that the Picture Library does.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm"&gt;http://www.flexnetconsult.co.uk/WebParts/WebParts.htm&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b75dd93-971f-48f1-b572-8e871668b53d" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</comments>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
  </channel>
</rss>