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

http://www.sharepointblogs.com/llowevad/archive/2008/02/18/workaround-for-creating-timer-jobs-after-a-restore-in-sharepoint.aspx

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

http://blogs.msdn.com/joelo/archive/2007/11/07/is-the-hotfix-or-service-pack-going-to-break-my-sharepoint-pages-or-deployment.aspx

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

http://mindsharpblogs.com/ben/archive/2008/01/08/4123.aspx

Installing SharePoint Server 2007 on Windows Server 2008 RC1

http://mindsharpblogs.com/ben/archive/2007/12/16/3837.aspx

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

http://mindsharpblogs.com/ben/archive/2007/11/21/3581.aspx

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

http://www.sharepointblogs.com/llowevad/archive/2008/01/25/web-application-timer-jobs-not-automatically-created-when-restoring-from-sharepoint-backups.aspx

Verbose List of WSS 3.0 Events

http://blogs.msdn.com/joelo/archive/2008/02/07/verbose-list-of-wss-3-0-events.aspx

Verbose List of SharePoint Server 2007 Events

http://blogs.msdn.com/joelo/archive/2008/02/07/verbose-list-of-sharepoint-server-2007-events.aspx

Verbose List of WSS 3.0 Events

http://blogs.msdn.com/joelo/archive/2008/02/07/verbose-list-of-wss-3-0-events.aspx

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

http://mindsharpblogs.com/Phil/archive/2007/11/16/3545.aspx

Fun with Content Types

https://sharepointelearning.securespsite.com/screencasts/blog/Lists/Posts/Post.aspx?List=91d2ba00%2D408d%2D4f1a%2D99b5%2D4514aaa35128&ID=25

EndUserSharePoint.com

http://www.endusersharepoint.com/

Advanced Lectures and WhitePapers (Great Resource)

http://bobfox.securespsite.com/FoxBlog/Lists/Posts/Post.aspx?List=0d457cd0%2D1f17%2D45c1%2D861a%2D8a32a351d6ae&ID=72

Tuesday, February 19, 2008

Windows 2008 and SharePoint Server 2007

Great article by Ben:
http://mindsharpblogs.com/Ben/archive/2007/12/16/3837.aspx

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 http://blogs.msdn.com/sharepoint/archive/2007/12/11/announcing-the-release-of-wss-3-0-sp1-and-office-sharepoint-server-2007-sp1.aspx

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 click...new group or domain...users..right click...new 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 http://clintcherry.spaces.live.com/Blog/cns!AEC0DCBC460E45B9!535.entry

Avoid using hyphens in site column names!
http://www.sharepointblogs.com/joed/archive/2008/02/06/avoid-using-hyphens-in-site-column-names.aspx
*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
http://www.sharepointblogs.com/grayghost/archive/2008/02/09/developing-migration-methodologies.aspx


SharePoint and HttpModules - 1 / 3
http://translate.google.com/translate?u=http%3A%2F%2Fwww.gatweb.fr%2FLists%2FBillets%2FPost.aspx%3FList%3D29f0ece6%252Ddd9b%252D454b%252Da6d4%252Dff5563516758%26ID%3D96&langpair=fr%7Cen&hl=en&ie=UTF8 *Translated French to English...

export/import site structure using XML
http://www.sharepointblogs.com/mingssn/archive/2008/02/06/export-import-site-structure-using-xml.aspx

Content Types: The little engine that could...
http://www.sharepointblogs.com/bluephaze/archive/2008/01/22/content-types-the-little-engine-that-could.aspx

Content Types: Part 2 - Creation and Association of Workflows and Document Templates
http://www.sharepointblogs.com/bluephaze/archive/2008/02/08/content-types-part-2-creation-and-association-of-workflows-and-document-templates.aspx

Announcing the DoD 5015.2 Resource Kit for SharePoint Server 2007
http://blogs.msdn.com/sharepoint/archive/2008/02/09/announcing-the-dod-5015-2-resource-kit-for-sharepoint-server-2007.aspx

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));
}
else
{ reloadTimer = null;
location.reload(true);
window.location.replace( sURL );
}
}

setReloadTime(30);
</script>

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 it...now 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 (http://technet.microsoft.com/en-us/library/bb878047.aspx):

"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:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/d5a92c2b-c860-48ac-b406-e33ab4ac4e6e.asp.

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:

http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/featured/iis/default.mspx."

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
SharePoint AJAX Toolkit
http://www.codeplex.com/sharepointajax

People-Picker Control for InfoPath 2007
http://metahat.blogspot.com/2007/05/people-picker-control-for-infopath-2007.html

Free Tool: Register Event Handlers Programmatically
http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1547

SharePoint and Managed Paths
http://www.sharepointblogs.com/llowevad/archive/2007/10/24/sharepoint-and-managed-paths.aspx


.Net
Use the advantages of custom attributes in your C# applications
http://articles.techrepublic.com.com/5100-3513_11-6175490.html

Fixed Header and Footers in GridView
http://www.codeproject.com/KB/aspnet/Gridview_Fixed_Header.aspx

HttpWebRequest and Ignoring SSL Certificate Errors

http://csharpfeeds.com/post.aspx?id=4798