smtp4dev - Awesome development tool

by josh 4. May 2010 06:58

At SharePoint Saturday Huntsville I showed a tool during my workflow presentation that runs in your tray and monitors Port 25 for SMTP traffic. When a message gets sent to Port 25 (say, from the SharePoint timer job), this tool grabs it and shows it in a nice little grid, and also displays a popup notification if it’s minimized to the tray. Check it out:

 

image

 

image

 

You can grab this tool at http://smtp4dev.codeplex.com. Just run the EXE and it will start monitoring. Minimize and it will go to the system tray and alert you when a message comes through. Well done, rob@rnwood.co.uk!

Presenting 2 Sessions at SharePoint Saturday Huntsville

by josh 13. April 2010 08:14

I'll be presenting 2 sessions at the upcoming SharePoint Saturday event in Huntsville, AL on May 1, 2010.

Building a  Cloneable, Scripted SharePoint 2010 Development Environment

SharePoint 2010 Workflow – Business Analyst to Developer

 

 This is actually my first SharePoint Saturday to attend or present, so I'm excited. For those in Huntsville or the surrounding areas, you can register here.

 

Creating a cloneable SharePoint 2010 Development Environment with PowerShell, Windows Sysprep, and SQL Server 2008 R2 Sysprep – PART 1

by josh 26. March 2010 02:53

In the previous post, I outlined the steps involved in creating a cloneable image that can be quickly spun up into a working SharePoint 2010 development machine. In this post, I want to visit Steps 1-5 in more detail.

 

  1. Install a virtual machine with Windows Server 2008 R2, PowerShell 2.0 and all other desired client software (Visual Studio, Office, SharePoint Designer, etc…)
  2. Install SQL Server 2008 R2 as a Prepared Image
  3. Install SharePoint 2010 Prerequisites (http://technet.microsoft.com/en-us/library/cc262485(office.14).aspx) either manually or using the Prerequisites Installer tool
  4. Install SharePoint 2010 bits, but DO NOT run configuration wizard
  5. Run Sysprep.exe to prepare server

 

Step 1 – Install OS and Client software

I won’t go into a whole lot of detail on this step because it should be pretty straightforward. For my SharePoint 2010 development machine I run Windows Server 2008 R2 and the following client software:

  • Visual Studio 2010
  • SQL Management Studio
  • Office 2010 (including Visio Premium for workflow visualization)
  • SharePoint Designer 2010
  • Other useful tools (Reflector, U2U CAML Query tool, CodeRush/Refactor Pro, …)

Step 2 – Install SQL Server 2008 R2 as a Prepared Image

**This is a feature of R2. SQL Server 2008 (pre-R2) does not have the Sysprep functionality.

Performing these steps will install the SQL Server 2008 R2 bits and prepare the server to be configured at a later time.

  1. Run the SQL Server 2008 R2 setup executable.
  2. On the Installation Center dialog, choose Advanced from the menu on the left. 
    sql installation center
  3. Click the Image preparation of a stand-alone instance of SQL Server link. 
    sql installation center - prepare image
  4. When the System Configuration Checker completes, click OK.
  5. Accept the license terms and click OK.
  6. On the Setup Support Files screen, click Install.
  7. When the setup files are installed, click Next and choose the features to be installed. 
    sql install feature sel
    **Only server features are available as part of the image preparation. Client features, such as Management Studio, can be installed normally before running Sysprep on the machine.
  8. On the Instance Configuration screen, enter an Instance ID for the instance being prepared. This will be required when completing the image after cloning. 
    sql installation center - instance config
  9. On the Disk Space Requirements screen, review requirements and click Next.
  10. On the Prepare Image Rules screen, verify that there are no errors or warnings and click Next.
  11. On the Ready to Prepare Image screen, review settings and click Prepare.
  12. On the Complete screen, click Close.

Step 3 – Install SharePoint 2010 Prerequisites

SharePoint 2010 includes a new Prerequisites installer that will automatically download and install the necessary prerequisites. Of course, you must be connected to the internet for the prerequisites to be downloaded. You can alternatively download the prerequisites manually and install them one-by-one. (http://technet.microsoft.com/en-us/library/cc262485(office.14).aspx)

  1. Open the SharePoint 2010 installation media and run PrerequisiteInstaller.exe.
  2. Review the prerequisites that will be installed and click Next
    spprereq1
  3. Accept the license terms and click Next.
  4. When the installation completes, click Finish.
  5. Restart the VM.

Step 4 – Install SharePoint Server 2010 Binaries

  1. Open the SharePoint 2010 installation media and run Setup.exe.
  2. Enter the license key and click Continue.
  3. Choose Server Farm install.
  4. On the Server Type screen, choose Complete and click Install Now.
  5. When installation is compl ete, on the Run Configuration Wizard screen, clear the Run the SharePoint Products Configuration Wizard now checkbox and then click Close
    sharepoint install 1

Step 5 – Run Sysprep to Prepare Machine for Cloning

  1. Navigate to C:\Windows\System32 and run Sysprep.exe
  2. In the System Preparation Tool dialog, in the System Cleanup Action section, choose Enter System Out-of-Box Experience(OOBE) and select the Generalize checkbox.
  3. In the Shutdown Options section, choose Shutdown and click OK
    sysprep dialog
  4. Sysprep will configure the machine and then automatically shut down.

The base virtual machine image is now ready to be cloned. I’ll detail the process of cloning the VM and scripting the configuration of SQL Server and SharePoint in the next post…

Creating a cloneable SharePoint 2010 Development Environment with PowerShell, Windows Sysprep, and SQL Server 2008 R2 Sysprep – Overview

by josh 26. March 2010 02:50

Goal: To be able to execute a single command and have a fresh, sysprepped, SharePoint 2010 development environment ready to go within minutes.

 

**Note I’m using VMware Workstation, but you should be able to use other virtualization software as long as it supports 64-bit operating systems)

 

With most SharePoint development being done in VMs, it is useful to have a set of sysprepped base VMs that can be cloned at any time to create a new environment, whether it be for a new project, to test some tool or software, or whatever. Sysprep is a great tool for virtual domains because it will generate a new security ID (SID) for every server created from the sysprepped image to prevent conflicts between servers on the same domain.

 

Most of the software needed for development can be installed prior to running sysprep on the virtual machine,but SQL Server and SharePoint (at least the configuration of SharePoint) are generally exceptions. These apps typically must be installed post-sysprep in order for them to operate correctly, and this is an involved and tedious process. Fortunately with SQL Server 2008 R2, we now have SQL Server Sysprep, which will allow SQL Server to be installed and imaged, but not configured until a new VM is created from the base image. Woohoo!

 

So, the general steps are as follows:

  1. Install a virtual machine with Windows Server 2008 R2, PowerShell 2.0 and all other desired client software (Visual Studio, Office, SharePoint Designer, etc…)
  2. Install SQL Server 2008 R2 as a Prepared Image
  3. Install SharePoint 2010 Prerequisites (http://technet.microsoft.com/en-us/library/cc262485(office.14).aspx) either manually or using the Prerequisites Installer tool
  4. Install SharePoint 2010 bits, but DO NOT run configuration wizard
  5. Run Sysprep.exe to prepare server
  6. Clone server
  7. Boot clone and execute PowerShell script to perform the following actions:
    • Complete configuration of sysprepped SQL Server 2008 R2 database server
    • Configure SharePoint 2010 farm

 

The PowerShell script can perform as much (or as little) configuration of the SharePoint environment as you wish. There are a whole slew of new cmdlets (Gary LaPointe lists all 535 of them here) that come with SharePoint 2010, so most actions are as easy as finding the appropriate cmdlet to run.

 

I’m going to split the detailed steps into two separate posts to make them a little more manageable. The first will cover steps 1-5 above, and the second will cover the rest of the steps.

Lightning Conductor Web Part Sample XSL

by josh 15. March 2010 10:33
We've been looking for a good web part to use for rolling up list data from various site collections within a SharePoint web application.  After trying a couple of different ones, including the Bamboo List Rollup Web Part and the Lightning Conductor Web Part, I have chosen the Lightning Conductor web part for our list roll-up needs.  It works very similar to the Content Query Web Part that comes with MOSS Enterprise, but will roll-up data across multiple site collections.  It also has some added features like the ability to specify which columns to display in the gridview, and you can turn on paging and specify how many items to display on each page all from the toolpane window.  Very nice!
 
The purpose of this post was actually not an overview of the LCWP - there's already a good one here.  One of the options available with the web part is the ability to specify your own XSL file for formatting.  My current project involves a highly customized branding of the portal, so we don't want to have the plain old SharePoint blue web part stuck on this branded page.  We wanted to use our own custom color scheme, images, formatting, etc.  So I started trying to come up with an XSL file to do this, and then remembered I know nothing about XSL.  So after a quick intro to XSL, I opened up one of the sample XSL files and began to poke around. 
 
Without really knowing what the input xml looked like I wasn't sure of the xpath to use to access the list items being rolled up.  Well finally, after searching through the sample XSL file I figured it out. To loop through all rows returned, you can use the following XSL:
 
image
 
And then to access the value of a specific column you can use
 
 
image
 
where InternalColumnName is the Internal Name of the column you're referencing.
 
Hopefully this will save someone a little bit of time.  Thanks to the folks at Lightning Tools for a great web part!!
 
jgm