Joel's SharePoint Architect Blog

SharePoint 2010, MOSS & WSS Tips and Consultancy Tales

Subscribe Subscribe  View Joel Jeffery's profile on LinkedIn
joelblogs.co.uk | joelj.co.uk | joeljeffery.co.uk | jfdiphoenix.co.uk

Posts Tagged ‘SharePoint Architecture’

Despite protests from music lovers, here is another of the songs from my SharePoint Show.

This is a mix from several live versions. In this song we visit what you can and can’t do in the Sandbox, and the several ways in which the User Code Service protects our server from the evils of any user code that tries to run a “Bad Command”.

Apologies to Lady Gaga, and all those who have been affected by issues in this video.

Technorati Tags: SharePoint, SharePoint 2010 Training, SharePoint Administration, SharePoint Architecture, SharePoint Development, SharePoint Videos

I recently had a question from one of my students:

Every time I create a Visio diagram for a SharePoint farm, I start with an existing diagram and use the shapes from that. Are there any Visio stencils for SharePoint?

Yes! There are! You can download a set of Visio stencils for architectural drawings of SharePoint farms from Microsoft here: http://bit.ly/spstencil.

Example

The stencils let you produce diagrams like this one from TechNet: http://technet.microsoft.com/en-us/library/cc263199.aspx

Example SharePoint Architecture Diagram with Visio Stencils

Installation

You need to unzip this to your My Shapes folder under your Documents folder, e.g.:

"%USERPROFILE%\Documents\My Shapes"

Technorati Tags: SharePoint 2010, SharePoint Administration, SharePoint Architecture

Event Receivers and Content Deployment Jobs

SharePoint 2010 has many wonderful improvements over previous versions. One of which is a vastly improved Content Deployment mechanism and API.

If your application makes use of Event Receivers or Feature Receivers, these can, depending upon what they do, cause problems during a Content Deployment job. If you have code that you’d rather not execute when your event is triggered as a side effect of a Content Deployment job, you can use the SPImportContext object to find out if a job is running, and if so, to take alternative action.

Here’s an example on an ItemAdding Event Receiver (you’ll also need a using statement referring to the Microsoft.SharePoint.Deployment namespace)

   1: /// <summary>

   2: /// An item is being added.

   3: /// </summary>

   4: public override void ItemAdding(SPItemEventProperties properties)

   5: {

   6:     if (!SPImportContext.Current.IsRunning)

   7:     {

   8:         //TODO: add event receiver code here

   9:         base.ItemAdding(properties);

  10:     }

  11: }

If you miss this out this check in an Event Receiver or Feature Receiver, you might cause deadlocks or spurious List Items that you did not intend.

Technorati Tags: Development, SharePoint 2010, SharePoint Architecture, SharePoint Developer

Following on in my series of posts illustrating the various options for storing your application settings in SharePoint 2010, I had a query this week from one of my students.

How can I make web.config changes that apply to only one SharePoint Web Application?

In my example in part 1 (SPWebConfigModification: Persisting Configuration Data in SharePoint 2010) we learn that the Content Service (SPWebService.ContentService) has a WebConfigModifications collection that allows us to add the modifications we want to make.

It’s also possible to make web.config changes that apply to only the IIS Web Sites belonging to the Zones of a specific Web Application. The SPWebApplication object has its own WebConfigModifications collection.

Gotcha: The act of updating is still initiated by the SPWebService.ContentService object. After setting your WebConfigModifications on the SPWebApplication object, you still need to invoke Update() on ContentService.

   1: SPWebService service = SPWebService.ContentService;

   2: SPWebConfigModification myModification = new SPWebConfigModification();

   3: myModification.Path = "configuration/appSettings";

   4: myModification.Name = "add [@key='mySetting'] [@value='http://joelblogs.co.uk']";

   5: myModification.Sequence = 0;

   6: myModification.Owner = "AD\JOELJ";

   7: myModification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;

   8: myModification.Value = "<add key='mySetting' value='http://joelblogs.co.uk' />";

   9: /*Get reference to the WebApplication we want to administer*/ 

  10: SPWebApplication app = service.WebApplications["SharePoint - 80"];

  11: app.WebConfigModifications.Add(myModification);

  12:  

  13: /*Call Update on the WebApplication to save changes*/ 

  14: app.Update();

  15: /*Call ApplyWebConfigModifications to cause the Content Service to update the web.config files*/ 

  16: service.ApplyWebConfigModifications();

Links

For more information, have a look at the MSDN article on SPWebConfigModification.

Technorati Tags: Development, SharePoint 2010, SharePoint Architecture

If you have an existing SharePoint server farm – or any other kind of server farm on a Windows platform – one of the challenges you might face is identifying which servers could be suitable candidates for consolidating into virtual servers.

Luckily, there’s an app for that! Smile Check out the new Microsoft Solution Accelerator: Microsoft Assessment and Planning Toolkit (MAP) for server consolidation.

You can install it on a Windows 2008R2 server, such as your Hyper-V server, but you should note that it requires the ASP.NET 3.5 server role and and a suitable SQL edition installed (e.g. SQL Express 2005 SP3 or greater should do the trick).

The MAP tool creates an Inventory Database of suitable servers that it discovers on your estate. It collects all this information, but does this without needing to install additional agent software on your servers.

This seems pretty clever, and is achieved using a combination of Windows Remote Management and the Remote Registry service. The only requirements are that you’re local administrator on the servers you want to inventory, and you have WMI and file/print exceptions in your Windows Firewall rules.

The result of the process is a report that shows all physical machines and how suitable they are for virtualisation. It even checks hardware attached to the machines, whether they can support 64 bit OSes, and with Virtual Machine Discovery it also tells you what other virtual machines exist within your estate.

The tool will even export the report as an Excel spreadsheet for you to take away and analyse.

Gordon Ryan from those TechNet chaps has put together another video walking you through the process.

Technorati Tags: Administration, Hyper-V, SharePoint, SharePoint Architecture, Virtualisation