Determining the SharePoint 2007 version

If you need to know what service packs and cumulative updates are applied to your SharePoint 2007 installation, you have to go to the Central Administration | Operations | Servers in Farm and take note of the Database Schema Version.

After that, you can visit the page SharePoint MOSS 2007 Service Pack and Hotfix levels to check your SharePoint 2007 version with the table provided in the page.

It is possible to download the SharePoint 2007 updates from the Microsoft page Updates for SharePoint Products and Technologies.

SharePoint 2010 BCS: Use the BCS service account to access the SQL databases

When you create a new external content type in your BCS service, probably you create it from SPD using your own account, but it is a developer account; it would be prefereable, at runtime, to use the BCS service account instead.

But to do this, you have to open a SharePoint 2010 Management Shell from the start menu and give the following commands (more details in the posts SP 2010: BCS problem with AuthenticationMode and RevertToSelf and Authenticating to Your External System):

$bcsServiceApp = Get-SPServiceApplication | where {$_ -match "Business Data Connectivity Service"};
$bcsServiceApp.RevertToSelfAllowed = $true;
$bcsServiceApp.Update();

Now you can go to SPD, select your external content type, click the Edit Connection Properties ribbon icon and choose, as authentication mode, the BDC identity.

Finally you can re-deploy your external content type, but here there is an issue: you have to go back to the Central Administration and re-assign your permissions, because in the deployment they go lost!

SharePoint 2010: Business Connectivity Services

SharePoint 2010 introduces the Business Continuity Services (BCS), that allow SharePoint to access external systems: SQL databases (SQL Server, OLE DB, Oracle, ODBC) and WCF services; you can also access other systems implementing custom classes in .NET implementing specific behaviour.

In this way, you can "import" external data into SharePoint to have the following features (more details in the articles Business Connectivity Services overview (SharePoint Server 2010) and Using Business Connectivity Services in SharePoint 2010):

  1. view and manage external data with the usual web-parts, that allow you to do sortings and apply filters;
  2. crawl the external data and mix the search results with the other SharePoint search results;
  3. view and manage them from SharePoint, Outlook and SharePoint Workspace for offline access;
  4. reference the external data from lookup fileds and eventually import;
  5. define the CRUD operations (all of only some of them, for example for read-only access).

To be able to use them, you have to install the BCS service (more info in the article Business Data Connectivity Service - BDC metadata catalog is not available - Event 3011 (Duet Enterprise)):

  1. From Central Administration, Application Management, Manage Service Applications;
  2. from the ribbon, New Business Data Catalog Service, create the BCS service;
  3. back to Application Management, Manage Services on Server;
  4. start the Business Data Catalog Service service.

Now you have to create the External Content Type from SharePoint Designer (more details in the articles Using Business Connectivity Services in SharePoint 2010 and SharePoint 2010: Howto configure Business Data Connectivity access rights)

  1. From SPD, go to External Content Types, click the ribbon icon with the same name;
  2. important: click on the name and display name links to give a meaningful values (the text is displayed as a link insted of a textbox, so it is easy to forget and skip this step);
  3. click the "click here to discover external data sources..." link
  4. add connection, choose the correct external data type;
  5. for SQL Server data connections, give the server and database name; verify that you have the correct permissions to access the db, for example giving your account the db_data_reader and eventually the da_data_writer roles to the database; anyway for now choose the current identity to access the database (you can use the DBC service account following my guide SharePoint 2010 BCS: Use the BCS service account to access the SQL databases);
  6. expand the server node, open the tables/views tree node and right-click your table/view to create the desired CRUD operations;
  7. everntually create the desired filters to be used in the Choose Item popup (more details in a future article);
  8. click the Create List and Forms to create an External List referencing the new external content type.

Finally give permissions to the external content type:

  1. Back to Central Administration, Application Management, Manage Service Applications;
  2. select the BCS service and click the Manage icon;
  3. view your external content type, from the contestual menu give the permissions to the users that will access the external list based on the external content type.

About the permissions: each time you modify and redeploy your content type via SharePoint designer, permissions are lost, and you have to remember to set them!

Now from your site, under All Site Content, it will be possible to select the external list, to get and insert/update data.

In conclusion, in my article SharePoint 2010 BCS limitations I've listed some limitations about BCS.

SPSchedule.FromString

SharePoint 2007 allows you to define job definitions and schedule them, but you have to do it programmatically.

As it's impossible to change the job definition schedules from the UI, the preferred approach is:

  1. Define a feature that writes in the web.config the desired schedule
  2. Define a feature that schedules the job reading the desired schedule from the web.config

For second point, your friend is the SPSchedule.FromString static method, with returns an instace of a SPSchedule from a string that you can save in your web.config.
But how do you build this string?

You can refer to the definition of the method in the documentation page SPSchedule.FromString Method, that at the end of the page forwards you to the fantastic article SPSchedule.FromString(recurrenceValue) - syntax/format for recurrence value!

Order of Installation of SharePoint Patches

The general rule is that you have to install language pack and service pack according the chronological order they have been released (so that: “language pack”, “service pack 1”, “language pack of service pack 1”), keeping in mind that even if MOSS 2007 included WSS 3.0, both its service packs and its language packs don't.

So the order of installation is:

  1. WSS 3.0 language pack Italian
  2. MOSS 2007 language pack Italian
  3. WSS 3.0 service pack 1 English
  4. MOSS 2007 service pack 1 English
  5. WSS 3.0 language pack Italiano service pack 1
  6. MOSS 2007 language pack Italiano service pack 1
  7. WSS 3.0 service pack 2 English
  8. MOSS 2007 service pack 2 English
  9. WSS 3.0 language pack Italian service pack 2
  10. MOSS 2007 language pack Italian service pack 2

I add here recent packages:

  1. WSS 3.0 service pack 3 English x64 (here x86)
  2. MOSS 2007 service pack 3 English x64 (here x86)
  3. WSS 3.0 language pack Italian service pack 3 x64 (here x86)
  4. MOSS 2007 language pack Italian service pack 3 x64 (here x86)

Renaming a SharePoint 2007 Server

Sometimes you have the need to rename a SharePoint server. In my case, it happened when I created a "template" virtual machine and had to "deploy" it to the variour developers involved in the project.

So in the end I wrote the steps necessary to do it:

  1. Change the alternate access mappings
    From the Central Administration, go to Operations | Alternate access mappings
    Change each internal url to point to the new server name
  2. Run stsadm to rename the server
    From a command line prompt, execute:
    1. cd "c:\program files\common files\Microsoft shared\web server extensions\12\bin"
    2. stsadm -o renameserver -oldservername OldServerName -newservername NewServerName
  3. Rename the server, and reboot the computer
    If you are cloning a virtual machine, I reccomend you to use NewSID 4.10 (as it's no more possible to download it from Microsoft website, you can also find a backup copy in the file New_Sid.zip)
  4. Update farm credentials
    From a command line prompt, execute:
    1. cd "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
    2. stsadm –o updatefarmcredentials –userlogin "NEWSERVERNAME\SharePointAdministration" –password "NewPassword"

More details in the article Rename a stand-alone server (SharePoint Server 2007).