Thanks!

Updating Site Title (SPWeb web.Title) programmatically

Scenario:

Sharepoint 2010 (Server or Foundation) is installed, and you also have installed one or more language packs.

You update the SPWeb web.Title programmatically (web.Title = “New Title”, web.Update();) in C#, but the title is not updated in your browser. This will happen if your Sharepoint installation for example is English (1033), and your site is created in Norwegian (1044). It doesn’t matter if the installation language isn’t activated as a possible display language for your site, your updated title will only show when you choose the installation language as Display Language.

If you debug, you will se that the property web.Title is updated, but this is not what is shown in the browser. If you search further through the site’s properties when debugging, you will find a property called m_strTitle that holds your original title and obviously needs to beed updated. But, you cannot update this property directly.

So, how do you update the title in all Display Languages of the site?

SPUserResource resource = web.TitleResource;
foreach (CultureInfo culture in web.SupportedUICultures)
{
Thread.CurrentThread.CurrentUICulture = culture;
resource.Value = "New Site Title";
}

This also applies to for example web.Description, but not web.Name (which also is basis for the Site’s URL).

Remember to call web.Update, and ofcourse to do a web.Dispose if you are not using Using:)

Error installing Cumulative Updates

I was installing the latest Cumultative Updates (December 2010 version) on a small Sharepoint Server 2010 farm. I installed both the Foundation and Server hotfix package on the application server and then the web front end.

Next step was running the Sharepoint 2010 Products Configuration Wizard on the application server. The wizard started out just fine, but I only got to step 9 (“The farm is being upgraded in the timer service process. The task is 10.00% completed.”) where it subsequently failed (Configuration failed).  The error message was:

An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.  Additional exception information: Failed to upgrade SharePoint Products.”

Reading in the logs revealed what seemed to be why the upgrade failed, but no hint on how to fix it:

01/04/2011 15:27:39  14  INF                    Resource id to be retrieved is UpgradeTaskFailConfigSyncDisplayLabel for language English (United States)
01/04/2011 15:27:39  14  INF                    Resource retrieved id UpgradeTaskFailConfigSyncDisplayLabel is Failed to upgrade SharePoint Products.
01/04/2011 15:27:39  14  INF                  Leaving function StringResourceManager.GetResourceString
01/04/2011 15:27:39  14  INF                  Entering function Common.BuildExceptionMessage
01/04/2011 15:27:39  14  INF                    Entering function StringResourceManager.GetResourceString
01/04/2011 15:27:39  14  INF                      Resource id to be retrieved is ExceptionInfo for language English (United States)
01/04/2011 15:27:39  14  INF                      Resource retrieved id ExceptionInfo is An exception of type {0} was thrown.  Additional exception information: {1}

When I ran the Configuration Wizard again on the application server, it succeded, but I suspected the upgrade was not completed. I subsequently ran the Wizard on the WFE also, where the upgrade succeded. In Central Administration, I now had one “Succeded” Upgrade Session on the WFE and one “Failed” Upgrade Session” for the application server on the Upgrade Status Page in Central Administration.

Restarting the servers or running the Configuration Wizard either via different psconfig variations or UI did not give me a successful upgrade session for the application server.

The next day I also got a warning in the Health Analyzer:

Product / patch installation or server upgrade required.
All required products must be installed on all servers in the farm, and all products should have the same patching and upgrade level across the farm.
Upgrade is required on server APPSERVER. Without the upgrade, the server is not in a supported state.

Obviously not a perfect situation. The solution which solved the problem and completed the upgrade was also mentioned. Here is the Powershell command that did the trick for me:

PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

Sharepoint 2010 December Cumulative Updates

The December 2010 Cumulative Updates for Sharepoint Foundation and Sharepoint Server 2010 has been released. They seem to contain quite a few fixes, especially for the User Profile Service which from what I read will synchronize faster (It might actually look like this is the case, I think User Profile Synchronization was somewhat faster now). For some reason they are not published on the official Sharepoint Update page, which is why I am writing this post.

I have installed the updates in a 2-server farm, everything seems to work fine afterwards.

Unlike after the October Updates, I didn’t have to re-provision the User Profile Synchronization Service afterwards, as this service was listed as started when I had finished upgrading. (If re-starting/re-provisioning this service, remember to add the Farm Account to Local Administrators and reboot before starting the service).

I have linked to the downloads on my download page.

Version number after updating should be 14.0.0.5130.

Update: The December 2010 Updates are as of 07.01.2011 now available via the Sharepoint 2010 Update Resource Center.