Why I don’t use OpenWeb()

Posted on 14 CommentsPosted in Article, SharePoint 2007

This has come up in various conversations recently so I figured I’d write up a short post about it.  When trying to obtain an SPWeb object there are a couple of different options available using members of an SPSite instance.  The first, and more common, is the OpenWeb() method and the second is using the AllWebs[] property collection.  Here’s the problem I have with OpenWeb() (specifically the overload that takes no arguments) – consider the […]

Deleting Orphaned Event Receivers using PowerShell

Posted on 4 CommentsPosted in Article, Scripts, SharePoint 2007

While looking through the event logs at a client of mine the other day I came across an odd error that was occurring regularly.  Apparently they had developed a Feature which contained an Event Receiver which was programmatically bound to a series of lists.  As time went on their requirements changed so they deleted the event receiver class.  Problem was that the binding to the lists still exists so every time an item was updated […]

Ensuring a Valid SPContext via Feature Activation

Posted on Leave a commentPosted in Article, SharePoint 2007

I’ve been meaning to blog about this for a while but just haven’t gotten around to it.  Have you ever needed to add a web part to a page during Feature activation?  Of course you can do this declaratively using CAML but I usually prefer to do this stuff via code.  The challenge is that occasionally you will need to activate the Feature outside the context of a web request – such as via STSADM […]

Creating List/Library Folders Programmatically

Posted on 16 CommentsPosted in Article, SharePoint 2007

I’ve got this method that I keep copying and pasting into different solutions so I figured I’d post it here in case someone else could benefit from it.  You would think that it would be really easy to create folders in a list or library but oddly enough (or, if you’ve done SharePoint development long enough you would say typically enough), it’s not.  So, here’s a simple little method to help you get a folder […]

Web Part Page History CodePlex Project

Posted on 2 CommentsPosted in Article, SharePoint 2007

Have you ever been working with a web part page (either a standard web part page or a publishing page) and made a bunch of changes to your web part configurations and content over a period of time only to realize sometime down the road that you need to revert to a previous version?  You then go to the version history for the page and find the one you want, do the revert and then […]

Moving Databases, the Easy Way!

Posted on 123 CommentsPosted in Article, General, SharePoint 2007, SharePoint 2010

I’ve seen this come up a lot so I figured I’d write a short post about it.  A lot of people have been asking how to move their databases to a new server and to do this the way most people are prescribing you’ve got a lot of reading and a lot of steps to perform.  The following two post provide just a couple of examples of the numerous steps and issues to consider: http://techacid.spaces.live.com/blog/cns!6D62FC28E76BE4B!230.entry […]

Presetting Lookup Field Values via a Link

Posted on 2 CommentsPosted in Article, SharePoint 2007

On a recent project I had a need to relate one list to another.  The first list was a document library which stored project specs and the second was a list that contained user provided scores that were used to rank the projects.  One simple requirement I had was to be able to provide a link to enter a score for a given project and have the lookup field corresponding to the project preset with […]

Fun with Variations

Posted on 46 CommentsPosted in Article, SharePoint 2007

I’ve recently done a lot of work with my current client to get SharePoint variations working and as a result I’ve learned that you need to be very patient and persistent and keep a full bottle of Excedrin nearby.  Though this post is not directly related to stsadm extensions the results of my efforts on this project produced a couple of new commands which I’ll touch upon here and detail in a follow-up post.  Before […]

Getting Started with STSADM Extensions

Posted on 4 CommentsPosted in Article

Before I talk about the commands that I’ve created I wanted to spend a moment to show how I’ve approached the creation of the commands. If you’re faced with a situation like mine where you have to automate numerous MOSS configurations then you basically have two options – the first is to use STSADM (and possibly custom extensions) and the third is to just write your own console or WinForm app and plug away against […]