Archive

Archive for September, 2008

Renaming a single-server MOSS Virtual PC

September 23, 2008 5 comments

Background

Virtual PCs are commonly used for SharePoint development, an organisation might create a virtual server environment and allow developers to each have a copy.   In this scenario, SharePoint will typically have been installed and essential services such as Central Administration and Shared Services configured.

 

Each virtal environment will initially have the same computer name which must be changed to prevent problems with resolving the correct server if the virtual servers are added to the network.

 

Unfortunately renaming a SharePoint server is fraught with difficulty.   

 

Renaming a single-server MOSS virtual server

What is presented below is a step-by-step guide to renaming a single-server MOSS farm, with SQL Server on the same computer, which is typical of a developer virtual environment. 

 

Note: before starting this process, ensure that the virtual machine being renamed is not connected to the network, this will prevent inadvertently accessing the wrong Central Administration site.

 

The key is to rename SharePoint before renaming the server: 

  • Start the virtual machine and login
  • Open the Central Administration site for the server
  • On the Operations page, click on the Alternative Access Mappings link and update the link for the Central Administration site to use the new server name
  • Rename the SharePoint server using STSADM.  Open a command window and type:
    • stsadm -o renameserver -newservername <new name> –oldservername <old name>
  • Rename the computer to match.  Right-click on My Computer and select Properties.  Click on the Computer Name tab and then click the Change… button.  Type in the new server name.
  • Reboot when prompted
  • Update the farm administrator credentials.  Open a command window and type:
    • stsadm –o updatefarmcredentials –userlogin <new name>\<farm admin account> –password <password>
  • Reset IIS using the command window by typing:
    • iisreset /noforce
  • Open the Central Administration site:
    • Click on the server name in the Farm Topology
    • Click on the Office SharePoint Server Search link and update the accounts to use new server name
    • Click on the Windows SharePoint Services Help Service and update the accounts to use the new server name
  • Still within Central Administration:
    • Click on the Operation link in the left-hand navigation
    • Click on the Service Accounts link
    • Update the Service Accounts for both of the Shared Services and My Site Windows SharePoint Service Web Applications to use the <new name> in place of <old name>
  • Open the Shared Services Administration site:
    • Click on the Personalization Services permissions link
    • Update the accounts listed to use the <new name> in place of <old name>
  • Check the services on the farm by typing in the following URL: http://<central admin site>/_admin/checkfarmservices.aspx?source=/default.aspx
    • If the Search Service cannot be started, click on the link within the report and ensure that the accounts use the new server name
  • Reset IIS using the Command Window by typing:
    • iisreset /noforce
  • Open the SQL Server Management Studio and connect to the database called <new server>:
    • Expand the server tree to display the contents of the Security > Logins folder
    • Open the properties window for the service account used for the SharePoint Timer Service
    • On the User Mapping tab, ensure that the Map checkbox is ticked for each SQL Server database to which the account requires access (especially the Shared Services databases)
    • Rename each of the service accounts to use the <new name> in place of <old name>; just right-click on the account and select rename 

At this point the virtual machine should be ready for connection to the network.

 

Alternative

An alternative to doing this configuration on a per-machine basis is to create a clonable environment, Paul Horsfall describes just such an approach on his site.

Alphabetically ordered Site Map using Site Directory within MOSS 2007

September 15, 2008 Leave a comment

Here’s a quick and easy way to produce an alphabetically ordered Site Map using the Site Directory within Microsoft Office SharePoint Server 2007.

Open the the Pages library within the Site Directory site  – for a default MOSS installation this will be  http://yoursite/SiteDirectory/Pages/Forms/AllItems.aspx.

Select the Open in Windows Explorer option from the Actions menu.  Within the Explorer window, copy the sitemap.aspx page and rename the copied file to AlphabeticalSiteMap.aspx.

Navigate to the Site Directory landing page, http://yoursite/SiteDirectory/Pages/category.aspx, then select the Edit Page option from the Site Actions menu:

Click on the Add New Tab link and complete the fields as shown below the click on OK to create the new tab:

New Item form used to specify details of new Site Directory tab.

The new tab based upon AlphabeticalSiteMap.aspx will then be displayed.  At this stage it will be identical to the original Site Map tab.  

To customise the tab’s display options, click on the Edit Page option within the Site Actions menu and then click on Modify Shared Web Part option for the Site Map web part:

On the Site Map Web Part task pane, edit the Sort Sites By property to have the value Title:

Click OK to save the changes, and Publish the page as required.

Notes

The Site Map Web Part being customised is simply a Table of Contents Web Part and can be quite extensively customised.  

The content is drawn from the current (left-hand) navigation of the root site, and sub-sites if the Levels to show property is greater than 1.  This can cause problems as non-site items such as a Documents folder that appear in the current navigation also appear in the Site Map.  In addition, sites not listed in the current navigation will not appear in the Site Map.

This can be quite confusing, so I would recommend the following:

  • do not add folders to the current navigaton
  • add Sites to the current navigation and mark those that are not to appear within the left-hand navigation control as Hidden; update the Site Map Web Part and set the Include hidden sites checkbox

Modifications required to web.config file for SilverLight 2 Beta 2 and SharePoint

September 10, 2008 2 comments

In case anyone else was having difficulty with finding the correct entries add to the web.config to get SilverLight 2 Beta 2 to work with SharePoint, I’ve listed the changes below.

Add the following to the <configSections> section:

  <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
      <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
        <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
      </sectionGroup>
    </sectionGroup>
  </sectionGroup>

Add the following to the <assemblies> section:

  <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
  <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
  <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

Add the following to the <pages> section:

  <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  </controls>

Add the following to the <httpHandlers> section:

  <remove verb="*" path="*.asmx"/>
  <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

Add the following to the <httpModules> section:

  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 

For IIS 7.0, insert the following section:

    <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
        <remove name="ScriptModule" />
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </modules>
      <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <remove name="ScriptHandlerFactory" />
        <remove name="ScriptHandlerFactoryAppServices" />
        <remove name="ScriptResource" />
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </handlers>
    </system.webServer>

Add the following to the <assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″> sub-section under the <runtime> section:

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
  </dependentAssembly>

This information was gleaned from the video and web.config file produced by Patrick Tisseghem, I’d recommend giving his excellent blog post a read.

You will also have to add the System.Web.SilverLight.dll to the GAC.  This is to be found in the C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server folder if you followed the default installation of the SilverLight 2.0 Beta 2 SDK.

Finally, add the .xap extension as a MIME type within IIS.  To do this, open the Computer Management Console, right click on Internet Information Server and select Properties.  Within the dialog, click on the MIME Types… button then click New. 

Enter .xap for the Extension and application/x-silverlight-2-b2 for the MIME Type.