<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>MOSS 2007</title>
        <link>http://blogs.interakting.co.uk/ray/category/94.aspx</link>
        <description>Articles on Microsoft Office SharePoint Server 2007</description>
        <language>en-GB</language>
        <copyright>Raymond Little</copyright>
        <managingEditor>rlittle@businessdecision.co.uk</managingEditor>
        <generator>Subtext Version 1.9.5.177</generator>
        <item>
            <title>Adding Custom Properties to Search Results in MOSS 2007</title>
            <link>http://blogs.interakting.co.uk/ray/archive/2008/05/29/303.aspx</link>
            <description>A common request is to create custom user profile properties to store information about users, this is something I will covered in my previous post. This is helpful when viewing their profile but if this is an important piece of information then it is possible you may need to include this in the search results for the people search and this is what I shall be covering today. In this example my property is called 'TestProperty', see below.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="372" height="104" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 10_14_45.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Next I have populated my user profile to contain some test information for this property, see below&lt;br /&gt;
&lt;br /&gt;
&lt;img width="525" height="71" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 10_17_26.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Next you have to set up a new 'Managed Property' that relates to our new user profile property. To do this navigate to your shared service provider then select 'Search Settings'. Once in the search settings section click 'Metadata property mappings' this will then give you a list of all the existing properties. To create a new managed property click 'New Managed Property' in the toolbar. Enter the name, description, select the type of information it has to hold, this should match what you selected for the user property. The most important section on this page is the mapping property as this decides what crawled property your managed property is associated with. In this case I am mapping my new managed property to my user profile property, see below.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="589" height="443" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 10_56_15.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="441" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 10_56_35.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Once you have set up the new Managed Property you need to perform a full crawl to make sure the test data entered is picked up by the search results. Once the full crawl is finished you can check that the new property has information in it by clicking on 'Managed Properties' and then clicking on your newly created managed property and you should see in the 'Content using this property' section it will have the number of items using this property, see below.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="387" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 10_51_51.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Now we have the property with the data the next step is to adjust the search results to pull out the new property. In this example I will edit the people search core results web part but the same principle applies to any of the search web parts. First navigate to the people search results page and open the people search core results webpart editor. Second, expand the 'Results Query Option' and click in the 'selected columns' textbox. Once you have done this a button with three dots will appear on the right hand side of the textbox if you click on that it will open an editor with a list of all the columns that are available to be used to display information in the webpart, I find it easier to copy the content and paste it into visual studio but similarly you can used notepad or even edit it in the editor. Where ever you choose to edit the columns you need to copy one of the existing columns and replace the name with your own name, for some reason I could only get this to work if the name is &lt;span style="font-weight: bold;"&gt;ALL&lt;/span&gt; in capitals, see below.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="437" height="361" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 11_45_06.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to edit the XSL that is used to render the generated XML. To do this click on 'XSL Editor' under the 'Data View Properties' section. You can place the information anywhere you want but for this example I shall add it next to the other office profile information. The first step is to add the new property as a parameter to the 'DisplayOfficeProfile' again the name of the property must be capitalised for this to work, see below.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="625" height="236" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 11_50_32.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to change the 'DisplayOfficeProfile' template to include this new parameter and display the information. The screenshot below shows what the new template looks like.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="627" height="523" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_29_2008 , 11_50_49.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
If you now save the editor, save and close the web then publish the page if you perform another search you should see the information appear in the webpart. One thing i have noticed is sometimes when you make a change to the webpart and click 'OK' it will look like the webpart is throwing an error. I'm not sure why this is but if you publish the page and perform another search it works ok.&lt;br /&gt;
&lt;br /&gt;
Hope this help.&lt;img src="http://blogs.interakting.co.uk/ray/aggbug/303.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Raymond Little</dc:creator>
            <guid>http://blogs.interakting.co.uk/ray/archive/2008/05/29/303.aspx</guid>
            <pubDate>Thu, 29 May 2008 11:02:47 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/ray/comments/303.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/ray/archive/2008/05/29/303.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/ray/comments/commentRss/303.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.interakting.co.uk/ray/services/trackbacks/303.aspx</trackback:ping>
        </item>
        <item>
            <title>Setting up Site usage summary reports in MOSS 2007</title>
            <link>http://blogs.interakting.co.uk/ray/archive/2008/05/28/301.aspx</link>
            <description>Setting up the built in usage reports is an important step when configuring your web farm but it is something that can be easily missed. There are two different sets of reports you can use to anaylse the usage of your farm they are:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Site Usage Reports - These reports are used to analyse an individual site.&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Site Collection Usage Summary - These reports are used to analyse the site collection as a whole.&lt;br /&gt;
    &lt;/li&gt;
&lt;/ul&gt;
Both of these contain some similar statics on Requests, Users, Referrers, Destination Pages and Home Page that can be used to provide an insight into how both individual sites and the site collection is being access. The Site Collection Usage Summary also has some reports showing Search queries and Search results that again can help helpful in configuring your search settings to make it as easy as possible for user to find the information they are looking for.&lt;br /&gt;
&lt;br /&gt;
You can check if these reports are enabled by navigating to site settings and clicking on either one of the links. If the page looks like the example below then you still need to configure the farm. &lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="129" alt="" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_28_2008 , 12_19_34.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
To enable these reports there are two settings in central admin which you have to enable they are:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Usage Analysis Processing &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Usage Reporting&lt;/li&gt;
&lt;/ul&gt;
To enable Usage Analysis Processing navigate to the 'Operations' tab, next click on 'Usage analysis processing' located under 'Logging and Reporting', see below.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="429" height="547" alt="" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_28_2008 , 11_51_05.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
Next check both 'Enable Logging' and 'Enable usage analysis processing'. At this point you have two important considerations first which location you want to store your log files and second what time you want to run the processing at., see example below. &lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="270" alt="" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_28_2008 , 11_51_24.png" /&gt;&lt;br /&gt;
Considering the log locations first it is generally accepted that as most &lt;a target="_blank" href="http://office.microsoft.com/en-us/sharepointserver/default.aspx" title="MOSS 2007"&gt;MOSS&lt;/a&gt; 2007 log files can grow to significant sizes you should move them to another drive. I would follow this best practice and set the location to another drive which has additional space available. The next consideration is the time you want to run the processing at and again best practice dictates that these type of tasks should be done when the site is not being used. So with this in mind I usually set the time to the early hours of the morning. Once you are happy with these setting we need to move on to configuring the Usage reporting.&lt;br /&gt;
&lt;br /&gt;
You can find the Usage reporting in the setting for your Shared Service Provider under 'Office SharePoint Usage Reporting'.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="371" alt="" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_28_2008 , 11_51_41.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
To enable this all you have to do is check both 'Enable advanced usage analysis processing' and ' Enable search query logging'.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="212" alt="" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_28_2008 , 11_51_49.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
If you now navigate to either the Site usage summary or the Site collection usage summary you should see it now displays the reports. When you first view the reports most likely they will be blank, as below, this is because it only starts capturing the data once we have enabled the usage logging and we also have to wait until the analysis processing has been completed. &lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="335" alt="" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_28_2008 , 12_18_03.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
If you check the after the processing has been done you should see the reports will now contain data.&lt;img src="http://blogs.interakting.co.uk/ray/aggbug/301.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Raymond Little</dc:creator>
            <guid>http://blogs.interakting.co.uk/ray/archive/2008/05/28/301.aspx</guid>
            <pubDate>Wed, 28 May 2008 11:26:27 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/ray/comments/301.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/ray/archive/2008/05/28/301.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/ray/comments/commentRss/301.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.interakting.co.uk/ray/services/trackbacks/301.aspx</trackback:ping>
        </item>
        <item>
            <title>Threaded View for Discussion Boards in MOSS 2007</title>
            <link>http://blogs.interakting.co.uk/ray/archive/2008/05/13/273.aspx</link>
            <description>Does anyone know if there is a way in &lt;a target="_blank" href="http://office.microsoft.com/en-us/sharepointserver/default.aspx" title="MOSS 2007"&gt;MOSS&lt;/a&gt; 2007 to create a threaded view similar to the 2003 version with '+' and '-' to expand and collapse Discussions, see image below for example?&lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="171" alt="Discussion Boards in SharePoint 2003" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_13_2008 , 09_35_45(1).png" /&gt;&lt;img src="http://blogs.interakting.co.uk/ray/aggbug/273.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Raymond Little</dc:creator>
            <guid>http://blogs.interakting.co.uk/ray/archive/2008/05/13/273.aspx</guid>
            <pubDate>Tue, 13 May 2008 08:41:17 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/ray/comments/273.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/ray/archive/2008/05/13/273.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/ray/comments/commentRss/273.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.interakting.co.uk/ray/services/trackbacks/273.aspx</trackback:ping>
        </item>
        <item>
            <title>How to programatically generate list of document libraries in MOSS 2007</title>
            <link>http://blogs.interakting.co.uk/ray/archive/2008/05/09/272.aspx</link>
            <description>&lt;p style="margin-bottom: 12pt;" class="MsoNormal"&gt;During one of our recent projects we had a site, which contained multiple sites each several document libraries some of which were based on a custom list definition. During testing we noticed that all the document libraries based on our definition had 'Allow management of content types' set to no, which was a problem as we had create several content types that were to be used across the site. After some discussion we decided that there were two options:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;ul type="disc"&gt;
    &lt;li style="" class="MsoNormal"&gt;Manually set each document      library.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Write a custom application      to do it for us.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="MsoNormal"&gt;Given the size of the site and the time involved in setting each document library we decided that the best approach was to write a custom application to do this for us and this is what I shall be looking at today.&lt;br /&gt;
&lt;br /&gt;
My application was designed to only be used by my self or other developers and was for a very specific purpose, therefore was fairly basic but you could extract some of the settings from the actual code and create a generic application that could be tailored to extract a collection of any type of list or library across a site collection.&lt;br /&gt;
&lt;br /&gt;
The first problem I encountered was that while trying to run the application i didn't have appropriate permission so in order to get around this I used the RunWithElevatedPrivileges method to prevent this. The important part of this section is you must open the web before running the code with elevated permissions otherwise you will still encounter problems.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="769" height="114" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_9_2008 , 11_38_14.png" alt="" /&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600"
o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f"&gt;
&lt;v:stroke joinstyle="miter" /&gt;
&lt;v:formulas&gt;
&lt;v:f eqn="if lineDrawn pixelLineWidth 0" /&gt;
&lt;v:f eqn="sum @0 1 0" /&gt;
&lt;v:f eqn="sum 0 0 @1" /&gt;
&lt;v:f eqn="prod @2 1 2" /&gt;
&lt;v:f eqn="prod @3 21600 pixelWidth" /&gt;
&lt;v:f eqn="prod @3 21600 pixelHeight" /&gt;
&lt;v:f eqn="sum @0 0 1" /&gt;
&lt;v:f eqn="prod @6 1 2" /&gt;
&lt;v:f eqn="prod @7 21600 pixelWidth" /&gt;
&lt;v:f eqn="sum @8 21600 0" /&gt;
&lt;v:f eqn="prod @7 21600 pixelHeight" /&gt;
&lt;v:f eqn="sum @10 21600 0" /&gt;
&lt;/v:formulas&gt;
&lt;v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" /&gt;
&lt;o:lock v:ext="edit" aspectratio="t" /&gt;
&lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style='width:552.75pt;
height:86.25pt'&gt;
&lt;v:imagedata src="file:///C:\DOCUME~1\RAYMON~1.BDU\LOCALS~1\Temp\msohtml1\01\clip_image001.png"
o:href="http://blogs.interakting.co.uk/images/blogs_interakting_co_uk/ray/Screenshot%20-%205_9_2008%20,%2011_44_11.png" /&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img width="737" height="115" v:shapes="_x0000_i1025" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_9_2008 , 11_44_11.png" alt="" /&gt;&lt;!--[endif]--&gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the correct permission to access the site via the API I could then connect to the chosen site, specified via a textbox on the application, and iterate through the sites to find the selection of document libraries that match my criteria. The first step in achieving this is to open the SPWeb object again this time with the higher level of permissions and make sure there are webs within the site collection. Next I iterated through the list of SPWebs in the collection and then for each SPWeb called a separated method that looked at all the lists within that site.&lt;br /&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;img width="600" height="325" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_9_2008 , 11_54_59(1).png" alt="" /&gt;&lt;br /&gt;
&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" alt=""
style='width:654pt;height:354pt'&gt;
&lt;v:imagedata src="file:///C:\DOCUME~1\RAYMON~1.BDU\LOCALS~1\Temp\msohtml1\01\clip_image003.png"
o:href="http://blogs.interakting.co.uk/images/blogs_interakting_co_uk/ray/Screenshot%20-%205_9_2008%20,%2011_54_59.png" /&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;br /&gt;
The IterateThroughLists method is the one that performs the check to see if any of the document libraries in the given site matches the criteria I’m looking for and if it does set 'Allow management of content types' set to true. The first step is to get the collection of lists within the site and then iterate through the lists. Next I examine each item in the list collection and compare them against my criteria. In this example I am looking for document libraries based on my custom definition so I know that the base type must be 'Document Library' and I also know that the document libraries I’m looking for have certain TemplateFeatureId so I can match this against a specific GUID, set as a constant. Finally I check to see if the document library already has 'Allow management of content types' set to true if it does then i can ignore it otherwise set it to true.&lt;br /&gt;
&lt;br /&gt;
&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1027" type="#_x0000_t75" alt=""
style='width:569.25pt;height:343.5pt'&gt;
&lt;v:imagedata src="file:///C:\DOCUME~1\RAYMON~1.BDU\LOCALS~1\Temp\msohtml1\01\clip_image005.png"
o:href="http://blogs.interakting.co.uk/images/blogs_interakting_co_uk/ray/Screenshot%20-%205_9_2008%20,%2012_01_59.png" /&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img width="759" height="458" v:shapes="_x0000_i1027" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_9_2008 , 12_01_59.png" alt="" /&gt;&lt;!--[endif]--&gt;&lt;img width="759" height="458" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_9_2008 , 12_01_59.png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
One key thing that cause me some problems was not calling the Update method as without this the code makes the changes but does not save them. So even though you can debug through the code and watch it set 'Allow management of content types'  to true if you don't call the update method when you then look at the document library it will still say 'Allow management of content types' is set to no . I hope you found this useful and can see how easily it can be changed to look across sites and generate collections of lists given certain criteria.&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/ray/aggbug/272.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Raymond Little</dc:creator>
            <guid>http://blogs.interakting.co.uk/ray/archive/2008/05/09/272.aspx</guid>
            <pubDate>Fri, 09 May 2008 11:26:07 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/ray/comments/272.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/ray/archive/2008/05/09/272.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/ray/comments/commentRss/272.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.interakting.co.uk/ray/services/trackbacks/272.aspx</trackback:ping>
        </item>
        <item>
            <title>Creating a Theme in MOSS 2007</title>
            <link>http://blogs.interakting.co.uk/ray/archive/2008/05/08/271.aspx</link>
            <description>One of the most common and potentially one of most important tasks in a MOSS 2007 project is styling the site to match the clients branding. Our preferred method for doing this is to create a new theme and then to staple this to our custom site template. I will cover creating a custom site definition in a separate post, my main focus today is creating a new theme.&lt;br /&gt;
&lt;br /&gt;
The first step in creating your new theme is to copy an existing theme folder, can be found at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES, and re-name it. For the purposes of this example i have named mine 'NEWTHEME'.&lt;br /&gt;
&lt;br /&gt;
  &lt;img width="510" height="301" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_8_2008 , 16_23_08.png" alt="THEME" /&gt;&lt;br /&gt;
Next open the folder and re-name the .INF file to match the name of your folder. In this example i copied the Classic theme so changed CLASSIC.INF to NEWTHEME.INF. In addition in the NEWTHEME.INF file you have to change all references from Classic to NEWTHEME.&lt;br /&gt;
&lt;br /&gt;
&lt;img src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_8_2008 , 16_30_38.png" alt="THEME" style="width: 429px; height: 531px;" /&gt;&lt;br /&gt;
&lt;br /&gt;
Once you have created the new folder for your theme and re-named all references the next step is to add your theme into the list of available themes. To do this we have to add in an entry into SPTHEMES.xml, can be found at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033. Again the best option is to copy one of the existing 'Templates' nodes and re-name it to match your theme name.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="594" height="368" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_8_2008 , 16_39_00.png" alt="THEME" /&gt;&lt;br /&gt;
&lt;br /&gt;
If you now try and change the theme of an existing site you will now see your option.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="600" height="165" src="/images/blogs_interakting_co_uk/ray/Screenshot - 5_8_2008 , 16_45_34(1).png" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Following these easy steps will allow you to quickly set up a new theme and change the styling of your site. In my next post i will show you have to create a custom site definition that uses a feature to bind the theme created in this example to all sites created in based on our new custom site definition.&lt;img src="http://blogs.interakting.co.uk/ray/aggbug/271.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Raymond Little</dc:creator>
            <guid>http://blogs.interakting.co.uk/ray/archive/2008/05/08/271.aspx</guid>
            <pubDate>Thu, 08 May 2008 15:20:46 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/ray/comments/271.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/ray/archive/2008/05/08/271.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/ray/comments/commentRss/271.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.interakting.co.uk/ray/services/trackbacks/271.aspx</trackback:ping>
        </item>
        <item>
            <title>UPgrading SharePoint 2003 to MOSS 2007 via Database Migration Method</title>
            <link>http://blogs.interakting.co.uk/ray/archive/2008/03/14/233.aspx</link>
            <description>&lt;p style="margin-bottom: 12pt;" class="MsoNormal"&gt;I have recently been involved in upgrading an old SharePoint 2003 intranet, with minimum customization, to &lt;a title="MOSS 2007" href="http://office.microsoft.com/en-us/sharepointserver/default.aspx" target="_blank"&gt;MOSS&lt;/a&gt; 2007. At first on reading the documentation this seemed like a relatively easy process. According to the documentation the basic steps are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;ol type="1" start="1"&gt;
    &lt;li style="" class="MsoNormal"&gt;Install &lt;a title="MOSS 2007" href="http://office.microsoft.com/en-us/sharepointserver/default.aspx" target="_blank"&gt;MOSS&lt;/a&gt; on the new      server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Create a new website in IIS      on the new server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Copy over all      customizations, in my case none.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Configure the new farm i.e      mail settings, services on the servers in the farm.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Run prescan.exe on the      SharePoint 2003 content database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Mark the existing content      db as read only to prevent additional content being added.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Backup the database and      restore it onto the new database server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Create a new web      application; pointing it to the new website created in step 1 and change      the database name to the one you restored.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Click OK.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="MsoNormal"&gt;According to the instructions it will now go away and upgrade the old content database to &lt;a title="MOSS 2007" href="http://office.microsoft.com/en-us/sharepointserver/default.aspx" target="_blank"&gt;MOSS&lt;/a&gt; 2007. Unfortunately after following all the steps I encountered 88 errors during the upgrade process.  The error message I received was complaining about a webpart on peoples my sites but after much searching the internet I found only one article with the same problem, however they had not come up with a solution either. Thankfully my sites were not used very often and the content was often out dated. As a result I was able to get around this by deleting all my sites from the content database. Obviously this is not an idea solution as in most cases if you are performing an upgrade then people may want to take content across from their my site so if anyone has encountered this problem before and knows a better solution then please leave a comment.&lt;br /&gt;
&lt;br /&gt;
To get the upgrade working I not only had to delete all my sites from the web table in the database but also remove all references from other tables as well. This was a bit tricky as the WebId is referenced in multiple tables so i checked each table and if there was a reference to WebId I ran an SQL script to delete all entries from that table which were in the web table and are a my site, see script below.&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
FROM         WebMembers&lt;br /&gt;
WHERE     (WebId IN&lt;br /&gt;
                          (SELECT     Id&lt;br /&gt;
                            FROM          Webs&lt;br /&gt;
                            WHERE      (FullUrl LIKE 'personal/%')))&lt;br /&gt;
&lt;br /&gt;
After doing this I re-tried the upgrade and everything went ok. Again this could potentially be an issue if you want to keep the my sites from the SharePoint 2003 site. As mentioned earlier if you know another way around this then please let me know.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Some other site I found useful for upgrade were:&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;a href="http://alancoulter.blogspot.com/2007/05/ms-advantages-sps-to-moss-2007-upgrade.html"&gt;http://alancoulter.blogspot.com/2007/05/ms-advantages-sps-to-moss-2007-upgrade.html&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;a href="http://joeloleson.spaces.live.com/Blog/cns!B05AD15E2DE730DD!364.entry"&gt;http://joeloleson.spaces.live.com/Blog/cns!B05AD15E2DE730DD!364.entry&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;a href="http://geekswithblogs.net/RogueCoder/archive/2007/05/08/112343.aspx"&gt;http://geekswithblogs.net/RogueCoder/archive/2007/05/08/112343.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;a href="http://www.sharepointblogs.com/johnwpowell/archive/2007/07/12/migrating-sharepoint-portal-2003-database-to-sharepoint-2007-using-content-database-migration.aspx"&gt;http://www.sharepointblogs.com/johnwpowell/archive/2007/07/12/migrating-sharepoint-portal-2003-database-to-sharepoint-2007-using-content-database-migration.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc263299.aspx"&gt;http://technet.microsoft.com/en-us/library/cc263299.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;br /&gt;
&lt;br style="" /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br style="" /&gt;
&lt;!--[endif]--&gt;&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/ray/aggbug/233.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Raymond Little</dc:creator>
            <guid>http://blogs.interakting.co.uk/ray/archive/2008/03/14/233.aspx</guid>
            <pubDate>Fri, 14 Mar 2008 15:13:44 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/ray/comments/233.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/ray/archive/2008/03/14/233.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/ray/comments/commentRss/233.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.interakting.co.uk/ray/services/trackbacks/233.aspx</trackback:ping>
        </item>
        <item>
            <title>Sorting People search in MOSS 2007</title>
            <link>http://blogs.interakting.co.uk/ray/archive/2008/01/14/165.aspx</link>
            <description>&lt;p class="MsoNormal"&gt;During a recent project one of the requirements was for a user to be able to search for people based on their last name. To achieve this I put a content editor web part on one of the pages and wrote some html that added links to the search centre appending the search criteria on the URL. The problem with this was the MOSS people search doesn't allow you to easily sort by name. Initially I thought I could append the XSL and use this to sort the results, however this only sorts the results returned on that page. For example if you have 100 results and you are displaying 50 results per page, this is the maximum, then  the sorting will only apply to the first 50 results. At first I thought there would be another way around this as it seemed like a logical thing to be able to do but after much investigation I learned that the best option available was to write a custom page that would pull out all profiles,  sort them and display them my self. &lt;br /&gt;
&lt;br /&gt;
I have broken the tasks required to achieve this into the following steps. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;ol type="1" start="1"&gt;
    &lt;li style="" class="MsoNormal"&gt;Determine the sort criteria&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Connect to the SharePoint      site&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Execute custom code with      elevated permissions&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Reconnect to the SharePoint      site&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Retrieve a list of users&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Sort the Users&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Bind them to Gridview&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
    &lt;li style="" class="MsoNormal"&gt;Give users access&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="margin-left: 18pt;" class="MsoNormal"&gt;I will now cover each of these in turn: &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Determine the sort criteria&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The first step is to determine what the user is trying to search for. As I mentioned earlier in the article the users access this page by clicking on a link in a custom web part that points them to my page passing the search parameters so I need to retrieve this information and assign it to a variable. &lt;br /&gt;
&lt;br /&gt;
                strProfileType = Request.QueryString["ProfileType"];&lt;br /&gt;
                strLastName = Request.QueryString["LastName"];&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Connect to the SharePoint site&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;As I have created a separate page out with SharePoint the first step I had to perform was to connect to the site using the credentials of the user accessing the page.&lt;br /&gt;
&lt;br /&gt;
                SPWeb theWeb = new SPSite(strURL).OpenWeb();&lt;br /&gt;
                SPUser currentUser = theWeb.CurrentUser;&lt;br /&gt;
&lt;br /&gt;
                using (SPWeb webInUserContext = SPContext.Current.Web)&lt;br /&gt;
                {&lt;br /&gt;
                    // get current web and site guids from the current context&lt;br /&gt;
                    webGuid = webInUserContext.ID;&lt;br /&gt;
                    siteGuid = webInUserContext.Site.ID;&lt;br /&gt;
&lt;br /&gt;
                    SPSecurity.CodeToRunElevated elevatedGetUsers = new SPSecurity.CodeToRunElevated(GetUsers);&lt;br /&gt;
                    SPSecurity.RunWithElevatedPrivileges(elevatedGetUsers);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Execute custom code with elevated permissions&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;This section is import as if you don't include it you will find that when you try and loop through the profiles returned by the profile manager in the next section it will give you an error. See code above for example&lt;/p&gt;
&lt;p style="margin-left: 18pt;" class="MsoNormal"&gt;&lt;strong&gt;&lt;br /&gt;
Reconnect to the SharePoint site&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;In the GetUser method we now have to re-connect to the site as the impersonated user, which should now have permission to enumerate through the profiles. Otherwise the page would still think it was connected as the user trying to access the page and will say you don't have access.&lt;/p&gt;
&lt;p style="margin-left: 18pt;" class="MsoNormal"&gt;&lt;br /&gt;
             // get the site in this context&lt;br /&gt;
            SPSite site = new SPSite(siteGuid);&lt;br /&gt;
            &lt;br /&gt;
            // get the web in this context&lt;br /&gt;
            SPWeb web = site.OpenWeb(webGuid);            &lt;br /&gt;
            SPSite oPortalSite = new SPSite(strURL);&lt;br /&gt;
            ServerContext oContext = ServerContext.GetContext(site);&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
Retrieve a list of users&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;My first step in this section was to create a structure to hold the profile information so I could make use of it later on. For this I decided to use a generic list based on the SharePoint UserProfile class this way I can make use of the built in methods to access the information I am interested in. Next I created an instance of the profile manager class supplying the context obtain from above and looped through the list of profiles adding each one to my generic list. In this example I have added some checks to restrict the number of users returned as I am only interested in users whose last name starts with the supplied criteria but you can quite easily change this for your purposes.&lt;strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;            List&amp;lt;UserProfile&amp;gt; oPeopleList = new List&amp;lt;UserProfile&amp;gt;();&lt;strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;            UserProfileManager profileManager = new UserProfileManager(oContext, true);&lt;br /&gt;
&lt;br /&gt;
            strMySiteUrlHost = profileManager.MySiteHostUrl;&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
            foreach (UserProfile profile in profileManager)&lt;br /&gt;
            {              &lt;br /&gt;
                if (strLastName != null)&lt;br /&gt;
                {&lt;br /&gt;
                    if (profile["lastname"].Value != null)&lt;br /&gt;
                    {&lt;br /&gt;
                        if (profile["lastname"].Value.ToString().ToLower().StartsWith(strLastName.ToLower()))&lt;br /&gt;
                        {&lt;br /&gt;
                            oPeopleList.Add(profile);&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Sort the Users&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;Now I have my list of users I can now perform the sort and in this example I have done so by creating a comparison delegate, which I can use to overwrite the existing sort method. It takes two user profile objects and compares the last name values to determine the order they should be in. Now that I have this generic comparison method I can pass this to the sort method on my generic user profile list and this will sort it by last name.&lt;strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;        /*Comparison delegate used for sorting*/&lt;br /&gt;
        static int LastNameComparision(UserProfile x, UserProfile y)&lt;br /&gt;
        {&lt;br /&gt;
            return x["lastname"].Value.ToString().CompareTo(y["lastname"].Value.ToString());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        oPeopleList.Sort(LastNameComparision);&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Bind them to Gridview&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;The second last step I will cover in this blog was to bind my generic list to my gridview. This is doesn't require much explanation as I’m sure most people will have done this before. My first was to perform a simple check to establish if there are any results, if so I perform the sort as described above then I bind the list to the gridview. &lt;strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;            if (oPeopleList.Count &amp;gt; 0)&lt;br /&gt;
            {&lt;br /&gt;
                oPeopleList.Sort(LastNameComparision);&lt;br /&gt;
                grd_member_search_results.DataSource = oPeopleList;&lt;br /&gt;
                grd_member_search_results.DataBind();&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                LblError.Visible = true;&lt;br /&gt;
                LblError.Text = "Sorry there are no results returned. Please try again";&lt;br /&gt;
            }&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;         &lt;br /&gt;
Obviously since we are binding the datasource to the gridview in the code behind you will still need to alter the gridview to pull out the columns you are interested in and perform some formatting to the look and feel.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Give users access&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;There is one final step that we must take in order for users to be able to access this information and that is to give the network service account 'Manage User Profiles' and ‘Use Personal Features’ permission in the Shared Service Provider. To do this open central admin, click on the shared service provider, select manage permissions then add the user and give them the above permissions. This is key as otherwise you will get an access denied error on the page. I must thank Edin Kapic for this as I spent a long time trying to identify what the error was before finding his blog. You can find more information on this here &lt;a href="http://edinkapic.blogspot.com/2007/08/enumerating-user-profiles.html"&gt;edinkapic.blogspot.com/2007/08/enumerating-user-profiles.html&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;Conclusions&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;These are the basic steps needed to create a new page to perform custom people searching, however you may need to custom this for your own purposes. I hope this was helpful&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/ray/aggbug/165.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Raymond Little</dc:creator>
            <guid>http://blogs.interakting.co.uk/ray/archive/2008/01/14/165.aspx</guid>
            <pubDate>Mon, 14 Jan 2008 22:50:14 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/ray/comments/165.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/ray/archive/2008/01/14/165.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/ray/comments/commentRss/165.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.interakting.co.uk/ray/services/trackbacks/165.aspx</trackback:ping>
        </item>
    </channel>
</rss>