Helpful Code

HOW TO: Create a Sandbox Compatible Visual Web Part with the Visual Studio 2010 SharePoint Power Tools

  Last week Mike Morton and the folks on the Visual Studio team released the Visual Studio 2010 SharePoint Power Tools.  The Visual Studio 2010 SharePoint Power Toolsextend the SharePoint 2010 project templates and provide the following enhancements. A sandbox-compatible Visual Web Part item template. Compile-time validation to ensure your code will run the the sandbox. This short HOW TO walks you through these features and demonstrates how to make a sandbox compatible Visual Web Part with the Visual Studio 2010 SharePoint Power Tools. To begin, go download the Visual Studio 2010 SharePoint Power Tools...

posted @ Monday, June 21, 2010 12:00 AM | Feedback (2)

Automating Windows 7 Boot Entry Creation With PowerShell

  Recently I needed to create an automated process to make boot entries for developer lab machines to allow them to boot to a virtual hard disk (VHD). The main requirements were to make the process simple and easily configurable. In this blog post I’ll show you the PowerShell script and accompanying XML settings file I used to get the job done. Configuration file The following XML configuration file (settings.xml) stores the settings for the boot entry.  It allows you easily configure where the VHD is located and the description you would like to give to the boot entry.  The Drive, Path, and...

posted @ Thursday, June 10, 2010 12:00 AM | Feedback (0)

HOW TO: Programmatically create a SharePoint 2010 External Content Type

  I demonstrated how to make an external content type programmatically during the SPC 405 - Business Connectivity Services Runtime and Object Model Deep Dive session at the 2009 Microsoft SharePoint Conference.  Since the conference I have received a couple of dozen emails about the this topic.  Most of the emails ask for the code samples and an explanation of the code, and at least half of the emails inquire about when and why you may need to create an external content type programmatically.  Because this is obviously a hot topic I decided to write it up in a blog post. Sample...

posted @ Tuesday, December 01, 2009 12:00 AM | Feedback (13)

Which SharePoint 2010 Site Template Is Right For Me?

  When MOSS 2007 came out I created a blog post very similar to this one.  It turned out to be one of my most popular posts and I received many comments and private emails thanking me for putting the post together.  Since the post helped out so many folks I decided to create an updated version for SharePoint 2010. SharePoint 2010 ships with many predefined site templates you may use to create site collections and sub sites. Sometimes the out of the box site templates will meet the needs of your project. Other times, the out of the box site templates may...

posted @ Friday, November 20, 2009 12:00 AM | Feedback (21)

HOW TO: Register an External Content Type with the SharePoint Search Service to make the data searchable

  In part 1of this blog post series I showed you how to create a .NET Assembly Connector to read data from a flat file.  This blog post shows you how to register an external content type associated with a .NET Assembly Connector with the SharePoint search search service so you can index and search the data coming from the external content type. The Business Context As I mentioned in part 1 of this blog post series, it’s commonplace to find critical business data stored inside flat files in large, mature organizations.  In addition to being able to browse the data inside web...

posted @ Thursday, November 12, 2009 12:00 AM | Feedback (4)

HOW TO: Create a Searchable SharePoint 2010 BDC .NET Assembly Connector Which Reads From A Flat File

  The Business Context In many large organizations business data is stored inside of flat files from mainframes or other legacy systems.  These systems chug along just fine everyday and support many key elements of the business; they aren’t going away anytime soon.  Traditionally, accessing flat file data, making it viewable in a web pages, and making it searchable requires an enormous amount of custom code.  The Solution New functionality inside SharePoint 2010’s Business Connectivity Services (BCS) makes it extremely easy to connect to flat file data sources (or any other data source), display it in web pages, and make it searchable.  This...

posted @ Thursday, November 05, 2009 12:00 AM | Feedback (15)

HOW TO: Create a custom theme for SharePoint 2010

  Creating SharePoint themes used to require editing CSS style sheets manually or using a tool like SharePoint Designer.  Furthermore, packaging and deploying the themes required administrative access to the server.  This is no longer the case!  Now you can create a SharePoint theme without ever having to see a single CSS style and you can easily deploy it to your server and apply it all within your web browser!  Here's how it's done with Microsoft PowerPoint 2010. Create the theme First, open Microsoft PowerPoint 2010 and proceed to create an Office theme just like you would for a PowerPoint presentation.  See this...

posted @ Monday, November 02, 2009 12:00 AM | Feedback (20)

HOW TO: Create a custom site definition in SharePoint 2010

  This article describes how to create a custom site definition in SharePoint 2010.  The process to create a custom site definition has not changed much since the last version of SharePoint, the only differences are the directory names and some of the XML in the WEBTEMP files.  See this blog post if you would like to see how this is done in WSS 3.0 / MOSS 2007. Site Definition basics Site definitions are located in the following folder on the SharePoint server: C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates Each site definition has its own sub directory under this folder. Inside each site...

posted @ Monday, November 02, 2009 12:00 AM | Feedback (6)

SharePoint On The Web and AdventureWorks Travel Site Installer Released!

New content was added to the www.mssharepointdeveloper.com web site last week!  This content includes the SharePoint on the web modules and the much anticipated release of the AdventureWorks Travel Site installer! Update:  Download the installer here:  http://code.msdn.microsoft.com/spotw/Release/ProjectReleases.aspx?ReleaseId=2702 The new SharePoint On The Web modules cover the following topics: Getting Started with SharePoint Development on the Web Site Structure and Branding Custom Field Types and Mode FBA Authentication Web Interoperability SharePoint Search Content Deployment Minimal Publishing Site Definition ...

posted @ Monday, May 18, 2009 12:00 AM | Feedback (13)

TechEd 2009 BDC Session Materials

Thanks to everyone who came to my Go Beyond With The BDC! session last week at the Microsoft TechEd 2009 North America conference!  You can find the Site Template Package (STP) for the SharePoint site I used for my demos here.  See this post for more details about the AdventureWorks Travel Site that I used to demonstrate Silverlight, SharePoint, and the BDC working together. Andrew Connell and I will be posting the session materials from the session we co-presented - Extending the Content Query Web Part to Aggregate Data Across Site Collections and External Sources - sometime soon (this week or...

posted @ Monday, May 18, 2009 12:00 AM | Feedback (0)

HOW TO: Enhance SharePoint User Profiles With The Business Data Catalog

If you look hard enough you can find several articles on the Internet which describe different ways to enhance SharePoint User Profiles with the Business Data Catalog.  Each of the articles takes a different approach to implementing this functionality, however none of the articles provide a prescriptive step by step approach and end to end example.  This article is geared toward someone who has limited or no experience with the BDC and provides a prescriptive step by step approach and sample code. The other articles I found on the Internet about this topic include the following, they are well worth reading. ...

posted @ Sunday, March 08, 2009 12:00 AM | Feedback (21)

TechEd North America 2008 Session Materials : Creating Solutions with the Business Data Catalog

Thanks to everyone who came to my session last week at the Microsoft TechEd 2008 North America Developer conference!  It was really nice to see so many past students at the show and I enjoyed catching up with everyone.  On Wednesday night I had the chance to hang out with many of the Microsoft MVPs and watch the Blues Brothers kick it at the House of Blues.  Eric Shupps accompanied the Blues Brothers for a song, I wish I had a picture of it, I thought he did pretty well.  :)  I met Brett Lonsdale for the first time, Nick...

posted @ Saturday, June 07, 2008 5:57 PM | Feedback (3)

Creating Solutions with the MOSS Single Sign On Service Session Materials

WOW!  What a day!  First, I got to meet Greg Lemond!  He is a very down to earth guy and I really enjoyed spending some time with him.  It was an experience I will certainly remember forever!  Then, believe it or not, Master Chief himself showed up in our booth in the expo hall!  As soon as I get a copy of the pictures I'll post them here. :)  As if those two things were not enough excitement for one day; then I presented my Creating Solutions with the MOSS Single Sign On Service session and finally the day wrapped up...

posted @ Thursday, March 06, 2008 9:50 AM | Feedback (3)

Creating Solutions with the Business Data Catalog (BDC) Session Materials

What a fun week it has been so far at the Microsoft SharePoint Conference!  I just finished presenting my Creating Solutions with the Business Data Catalog (BDC) session and I'm looking forward to presenting my Creating Solutions with the MOSS Single Sign On Service session tomorrow.  Thanks to everyone who came to my session today!  All the code and materials for today's session are now available here. Enjoy!

posted @ Wednesday, March 05, 2008 1:52 AM | Feedback (12)

HOW TO: Programmatically customize site navigation in WSS 3.0 and MOSS 2007

Note: This is a repost of an article I posted while WSS 3.0 and MOSS 2007 were in the Beta stages.  The article was lost due to a server crash and many people have asked me to repost the article so I updated it with additional information, updates screen shots, and a handy little Windows Forms Application you can use to test these concepts out yourself, or build upon the code base to meet your own needs.  Enjoy! In the previous version of SharePoint the QuickLaunch menu was controlled via the ONET.XML file and ASPX pages that made up a Site Definition,...

posted @ Wednesday, December 26, 2007 6:36 PM | Feedback (44)

SharePoint Connections 2007 Code Samples and Session Materials

Updated 11/12/2007: The code for my BDC session is now available and linked to below.  Post-conference session materials have been distributed directly to post conference attendees. I'd like to say thank you to everyone who attended my sessions so at this year's SharePoint Connections Conference.  I met so many smart, easy going people at the conference, and the audiences were a real pleasure to present to.  It's not a conference I will soon forget. Click here, to download the SharePoint Toolkit application that I used during my SharePoint Object Model and Web Services Kick Start session. Click here, to download the Site Template Package (stp file) for...

posted @ Thursday, November 08, 2007 4:24 PM | Feedback (11)

Creating and deploying VSTO Documents inside SharePoint Document Libraries

This is a repost of an article that was lost due to a server crash.   Visual Studio Tools for Office (VSTO) Documents can be deployed to or utilized as templates for a SharePoint Document Library. The process to develop VSTO Documents, deploy them to the SharePoint server, and set the proper security policies on the client machine in order for the documents to run properly can be easily repeated once you understand all the pieces of the puzzle. I have not been able to find complete documentation for this process on the Internet to date. I have found several web pages...

posted @ Thursday, August 16, 2007 9:27 PM | Feedback (11)

Creating a custom Site Definition in WSS V3 / MOSS

Update 11-22-2009:  See this blog post if you would like to see how to do this in SharePoint 2010. The new version WSS 3.0 / MOSS 2007) of SharePoint brings some changes to the way Site Definitions are created and deployed to a SharePoint server. Additionally, the way Site Definitions are now architected has changed with the advent of Features. Although FrontPage 2003 has been significantly enhanced to become the Office SharePoint Designer, Features allow for more flexible deployments of functionality within SharePoint, and Master Pages allow us to change the look and feel of many sites inside SharePoint with a...

posted @ Thursday, August 16, 2007 9:20 PM | Feedback (35)

Adding a Document Library Feature to a Site Definition in WSS V3 / MOSS 2007

This is a repost of an article that was lost due to a server crash. One of the nicest things about Features in the new version of SharePoint is their ability to be added to a Site Definition by default. When you add a Feature to a Site Definition, that Feature is automatically available on a SharePoint site when you create a SharePoint site from the given Site Definition. This functionality allows developers to build Features and plug them into any Site Definition they choose. In the last version of SharePoint, functionality that can now be delivered in the form...

posted @ Thursday, August 16, 2007 9:17 PM | Feedback (14)

Creating a Custom Document Library Feature in WSS V3 / MOSS 2007

This is a repost of an article that was lost due to a server crash. Features are a powerful new set of functionality that MOSS 2007 comes with out of the box. Features allow you to deploy functionality inside your MOSS 2007 portal in a granular and loosely coupled fashion. The Document Library that many of the out of the box site definitions come with in MOSS 2007 is implemented as a feature. Building on this out of the box Document Library Feature you can create your own custom Document Library Features as well. Feature Basics To begin, let’s take...

posted @ Thursday, August 16, 2007 9:12 PM | Feedback (34)

Connected Page Viewer Web Part

This is a repost of an article on my blog that was lost during a server failure.  Historically, this has been one of the most popular articles on my blog, so I dug up the code and put it back online. The code you will find below is for a Connected Page Viewer Web Part for WSS V2 and SPS 2003.  The Connected Page Viewer Web Part consumes a URL from another Web Part that provides URLs.  This Web Part WORKS GREAT in WSS V3 and MOSS 2007 as well. Enjoy! using System;using System.Web.UI;using System.Web.UI.WebControls;using System.ComponentModel;using System.Xml.Serialization;using System.Security;using System.Security.Permissions;using Microsoft.SharePoint;using Microsoft.SharePoint.Utilities;using Microsoft.SharePoint.WebPartPages;using Microsoft.SharePoint.WebPartPages.Communication;using System.Text;using...

posted @ Thursday, August 16, 2007 8:11 PM | Feedback (20)

Which WSS 3.0 / MOSS 2007 site Template is right for me?

Update 11-22-2009:  See this blog post for the SharePoint 2010 version of this information. MOSS 2007 ships with many predefined Templates you may use to create Site Collections and sub sites. Sometimes the out of the box site Templates will meet the needs of your project. Other times, the out of the box site Templates may need to be enhanced. Knowing which site Template has the functionality you need to deploy, or use as a baseline for a custom Site Definition, is one of the key decisions you make when architecting a SharePoint deployment. This being said, it is important to...

posted @ Friday, June 29, 2007 3:48 PM | Feedback (22)

SharePoint Feature Manager Update 1.0.0.2

Today I updated the SharePoint Feature Manager to fix an interesting bug I found. On my development VPC that was upgraded from B2TR to RTM the path to the Features directory was: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES On my development VPC that has a fresh install of RTM the path to the Features directory is: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES The change in capitalization of the Web Server Extensions directory, highlighted in bold above, caused a path replacement inside the SharePoint Feature Manager to fail on the fresh install of the RTM build.  I've fixed the bug and the application...

posted @ Wednesday, May 23, 2007 2:00 AM | Feedback (3)

SharePoint Connections Session Follow Up: Create an Internet-Facing SharePoint Site

During the Create an Internet-Facing SharePoint Site session I covered the following topics. Setting up forms based authentication. Creating your own custom Master Pages and style sheets Personalizing site content for users. Leveraging the Business Data Catalog to surface and interact with back end systems. Each of these topics is broken down more in depth in this blog post.  All the code used during my demos can be found in the rar file linked at the end of this post. Setting up forms based authentication Because a...

posted @ Friday, April 13, 2007 3:01 AM | Feedback (2)

HOW TO: Create a custom Windows Workflow Activity and make it available in SharePoint Designer

Recently we (SharePoint Experts) have been utilizing Workflows inside MOSS to automate many of our internal business processes. Last night, while trying to automate a process, Dustin let me know that the Send an Email Activity, available by default in SPD, does not allow you to specify a from email address. He asked me if I could create a custom Workflow Activity to send emails that would provide the ability to specify a from email address. I looked at several examples on the Internet and inside the ECM Starter Kit and none of the materials I found online provide step...

posted @ Friday, March 09, 2007 2:06 AM | Feedback (26)

SharePoint Feature Manager Updated Version Now Available

Today I updated the SharePoint Feature Manager based on feedback I have received about the application.  The status text box now automatically scrolls after each operation is completed.  This should make the program easier to use. You can download it here.

posted @ Tuesday, March 06, 2007 1:01 AM | Feedback (0)

HOW TO: Prevent creation of sub sites within MOSS 2007 My Sites

What do you do to prevent your users from creating sub sites under their My Sites if you need to do so? Since there is not a way to shut down this ability from the Central Administration site you'll need to use some custom code to get the job done. The cool part is, I already wrote it for you. The solution I have created is very simple and leaves a very small footprint in your SharePoint environment, so it's easy to roll back to return your environment to a supportable state, or install future Service Packs. The solution I've...

posted @ Wednesday, November 15, 2006 5:44 AM | Feedback (9)

SharePoint Connections – Sessions Follow Up

First of all I would like to say THANK YOU to everyone who came to my sessions last week! I had a wonderful time presenting my sessions to some great audiences and I really enjoyed meeting so many people after the sessions were over. I also enjoyed meeting many of the presenters and SharePoint MVPs at the conference. It was really nice to finally meet some of the folks who I have traded emails with for such a long time. As I mentioned during the sessions, I'm following up on outstanding questions and comments in this post. I've broken down...

posted @ Tuesday, November 14, 2006 2:06 PM | Feedback (2)