Friday, February 29, 2008

SQL Database Management for SharePoint

Bill Baer as a new whitepaper on database management for SharePoint. This is a must read for SharePoint admins.

Some highlights from the paper:

  • rebuild and reorganize (reindex) the clustered index is what defragments a table.
  • reindex = defragment
  • In order to avoid a huge performance hit, do not set maintenance plans to shink the db.
  • be prepared - maintenance plans can be long running processes.

Wednesday, February 20, 2008

SharePoint 2007 Link Resources for 2/20/2008

Some links for 2/20/2008:

Workaround for creating timer jobs after a restore in SharePoint

Is the hotfix or service pack going to break my SharePoint pages or deployment?

Create SharePoint Server 2007 Crawl Rules using Forms Based Authentication (FBA)

Installing SharePoint Server 2007 on Windows Server 2008 RC1

Ben's 15 easy steps to extend a SharePoint Web Application

Web Application Timer Jobs not automatically created when restoring from SharePoint backups

Verbose List of WSS 3.0 Events

Verbose List of SharePoint Server 2007 Events

Verbose List of WSS 3.0 Events

Exception thrown when logging into SharePoint via FBA against a SharePoint List

Fun with Content Types

Advanced Lectures and WhitePapers (Great Resource)

Tuesday, February 19, 2008

Windows 2008 and SharePoint Server 2007

Great article by Ben:

Installing SharePoint Server 2007 on Windows Server 2008 RC1

1. You must enable the IIS7 Feature Role on Windows Server 2008 RC1 with .NET 3.0

From Control Panel, Programs and Features, Select 'Turn Windows Features On or Off'
Next, Under 'Server Manager, Features' Select '.NET Framework 3.0 Features'. When asked
to install the IIS7 role, select yes. Under IIS7 'Security', be sure to select the authentication
you want, i.e. Basic, NTLM, Kerberos, etc. Next, you must slipstream
Windows SharePoint Server 3.0 SP1 AND SharePoint Server 2007 SP1 into your SharePoint Server 2007
installation directory.

2. I used Winrar to extract the files from my SharePoint Server 2007 ISO, but you can also
copy them into a directory directly from the DVD. Create a directory, we'll use c:\Slipped for our installation point. Copy the entire DVD contents to c:\Slipped

3. Next, you must download and extract both Windows SharePoint Services SP1 and SharePoint Server 2007 SP1
you can get them here

First, create a directory to host the WSS 3.0 files after extraction. We will use c:\wsssp1
Second, create a directory to host the SharePoint Server 2007 files after extraction. We will use c:\mosssp1
Third, we will assume we have downloaded both service packs to c:\

Extract the WSS 3.0 service pack files by executing 'c:\wssv3sp1-kb936988-x86-fullfile-en-us.exe /extract:c:\wsssp1' Agree to the license terms, and the service pack will unpack.

Extract the SharePoint Server 2007 service pack by executing 'C:\officeserver2007sp1-kb936984-x86-fullfile-en-us.exe /extract:c:\mosssp1' Agree to the license terms, and the service pack will unpack.

4. Copy the service pack files from the above directories into the installation updates directory.

If you are using x64, replace the 'x86' in the following instructions.

Copy the contents of both c:\wsssp1 and c:\mosssp1 into 'c:\slipped\x86\updates'
5. Last, run the setup from the x86 directory, and it should install!

SharePoint and Active Directory Groups

There are two ways to create groups in AD - domain...right group or domain...users..right group. SharePoint cannot correct ly use groups where one of the CNs is "users" as is the case in the latter scenario above.

The right way to build groups in order to have SharePoint "like them" is by creating groups from the domain level.

Wednesday, February 13, 2008

SharePoint 2007 Link List - 2/13/2008

A list of links I have compiled lately that I feel are good articles:

Email enabled lists in SharePoint 2007!AEC0DCBC460E45B9!535.entry

Avoid using hyphens in site column names!
*although I have not tested out this theroy, it would make sense to me that all mathematical symbols would be unusable in site column names for this very reason.

Developing Migration Methodologies

SharePoint and HttpModules - 1 / 3 *Translated French to English...

export/import site structure using XML

Content Types: The little engine that could...

Content Types: Part 2 - Creation and Association of Workflows and Document Templates

Announcing the DoD 5015.2 Resource Kit for SharePoint Server 2007

Wednesday, February 06, 2008

Lesson Learned: Patching a SharePoint Server

SharePoint server unavailable after a patch is installed....

Yesterday evening our automated patching systems applied several patches to our development SharePoint server. When we came in this morning, the server was totally unresponsive. The event logs gave us very little to go on other than the following entry:
A database error occurred.

Source: Microsoft OLE DB Provider for SQL Server
Code: 4060 occurred 1 time(s)
Description: Cannot open database "SharedServices1_DB" requested by the login. The login failed.

Context: Application 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
So we set about trying to figure out what was going on. We checked IIS, SQL Server, Services - everything seemed to be in order. We checked Active Director to see if the service account was locked - nope. Hmm...this was baffling.

Finally as a last ditch try before we restored from a backup, we ran the SharePoint Products and Technology Configuration Wizard....and VIOLA! She was living again.

Doing a little more research into the patching and management of SharePoint servers, we read that certain MSFT Office Server patches and SharePoint patches require that once finished the administrator rerun this configuration wizard to finish the process.

The lesson we have taken from this fire-drill is as follows. Configuration Management is of the utmost importance. Our network and development teams will be formulating concise strategies going forward for config mgmt of our SharePoint systems but a high level view of how we are going to patch these systems is as follows:

1. P2V production SharePoint servers to Virtual Machines (VMs)
2. Apply patches to VMs
3. Test VMs
4. Backup production SharePoint servers (additional to normal nightly backups)
5. Apply patches to production SharePoint servers
6. Test production SharePoint servers
7. Destroy VMs created for patch test

This is just a quick idea of how we plan to implement patches in the future.

Tuesday, February 05, 2008

Auto-Refresh a SharePoint Page

This is more of a quick and dirty technique rather than an elegant, AJAX-based approach which might be more desirable.

Enabling your SharePoint page to refresh automatically after x seconds is as simple as adding a Content Editor web part and adding the following javascript to it in the source editor:

<script type="text/javascript" language="javascript">
var reloadTimer = null;
var sURL = unescape(window.location.pathname);

function setReloadTime(secs)
{ if (arguments.length == 1)
{ if (reloadTimer) clearTimeout(reloadTimer);
reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs)*1000));
{ reloadTimer = null;
window.location.replace( sURL );


This script will reload the page ever 30 seconds. In order to hide the web part from the view on the page, set the following properties:
Height: 0px
Width: 0px
Chrome Type: none
Under advanced uncheck all advaanced properties.

That should do your SharePoint page will auto-refresh every 30 seconds.

Good Luck...

Monday, February 04, 2008

Recycling the App Pool Remotely

When you are running SharePoint in the enterprise, inevitably you are going to need to recycle the SharePoint app pool. This is a valuable article from Microsoft TechNet I found so i did not have to log into the server to recycle it.

Taken from TechNet (

"This is a very good question and one that Microsoft gets asked frequently by customers. The short answer is, yes, this can be done remotely. The long answer though requires a little knowledge of scripting if you are running IIS 6.0 on a Windows Server 2003 RTM version.

The script you need to do this locally is in Windows Server 2003 Service Pack 1, available from the Microsoft Download Center.

The command-line syntax used locally is:

iisapp /p /r

For example, if the w3wp process was Process ID (PID) 1234, then the command issued is:

iisapp.vbs /p 1234 /r

You can also use the Application Pool's friendly name instead of the PID by using the /a switch instead of the /p.

You can view all the switches and options using the command-line help for iisapp.vbs by typing the command:

iisapp.vbs /?

However, the iisapp.vbs command-line utility does not support remotely connecting to a computer.

If you are familiar with developing scripts this problem is solved using Windows Management Instrumentation (WMI) scripting or Active Directory Services Instrumentation (ADSI). These technologies are well documented in MSDN and you can use the IIS provider to connect to and recycle the application pools.

For example, here is a simple sample script with no error checking or dialog boxes. It also accepts no switches. However, it enables you to remotely recycle an application pool when you supply the following pieces of information in the script:

  1. Target server Name (strServer)

  2. Target server Username (strUsername)

  3. Target server User Password (strPassword)

  4. Application Pool name

I hope this sample script gets you started on your way to recycling a worker process running on a remote IIS 6.0 server:

strServer = "MyServer" //Replace this with the target server name strUser = "Administrator" //Provide Administrator privilege credentials strPassword = "password" //Input Administrator privileged account password Set LocatorObj = CreateObject("WBemScripting.SWbemLocator") LocatorObj.Security_.ImpersonationLevel = 3 Impersonate LocatorObj.Security_.AuthenticationLevel = 6 Pkt Privacy (required for remote administration over WMI as of Win2k3 SP1) Set ProviderObj = LocatorObj.ConnectServer(strServer, "root/MicrosoftIISv2", strUser, strPassword) Set MyAppPool = ProviderObj.Get( "IIsApplicationPool=w3svc/apppools/DefaultAppPool" MyAppPool.Recycle

There is detailed information in the IIS SDK to help you write a script that can remotely connect to an IIS server at:

By the way, the iisapp.vbs file that is delivered with Windows Server 2003 Service Pack 1 (SP1) can easily be copied to a Windows Server 2003 RTM version. There was no change in functionality to the core server between RTM and Service Pack 1 that would cause this script to not work. However, the script does not work on IIS versions below 6.0.

To review the changes added to Service Pack 1 for IIS 6.0, please review the following document on Microsoft's Web site:"

More SharePoint? More .Net? What can I do better here?

Its been some time since i started blogging and I think my little space here has some good articles/tips and tricks for SharePoint/.Net developers.

My question to you is - what can I do better that you think might attract more readers? I am open to all suggestions.

And thanks to those who stop in to read my blog...

SharePoint 2007 Link List - 2/4/2008

Here is a list of resources I have compiled this past week:
SharePoint AJAX Toolkit

People-Picker Control for InfoPath 2007

Free Tool: Register Event Handlers Programmatically

SharePoint and Managed Paths

Use the advantages of custom attributes in your C# applications

Fixed Header and Footers in GridView

HttpWebRequest and Ignoring SSL Certificate Errors