Sunday, May 27, 2007

BartPE bootable live windows CD/DVD

I came across BartPE by accident and wondered what it was. Looking at Wikipedia it defines BartPE as:

"BartPE allows a user to boot Windows XP/Windows Server 2003 from a CD-ROM regardless of the condition of the installed operating systems on the internal hard drive. This means that the user can, for instance, recover data from a failed operating system installation, or reset a lost administrator password."

As such this is a brilliant admin and disaster recovery tool. There is also a small industry of numerous plugins to work with BartPE which look very useful. Full details at Bart's Preinstalled Environment (BartPE) bootable live windows CD/DVD

Tuesday, May 22, 2007

Sharepoint Web services - UpdateLists gotcha

After some success with Sharepoint Web services, adding fields to a list programmatically, I wanted to be able to also update and delete them from the same program.

Microsoft's sample code (which works ok) in both the WSS2 and WSS3 examples shows your being able to add 2 fields using the XML new field node definitions as follows:

HOWEVER if you try to delete or update these new fields you've added you get all sorts of nasty and unhelpful errors back saying that the web service won’t do what you’ve asked it.

After 4 or 5 hours of head scratching I eventually figured out that because the MS examples create fields that are derived from a BaseType ie FromBaseType="TRUE" - you can't update or delete a FromBaseType Field. (At least I can't find a way to do it - and it would seem to be a bad thing to do anyhow!) (link here to SPField.FromBaseType defn.)

So if you want to programmatically add new fields to Sharepoint lists, and you want to update or delete them afterwards DO NOT include the attribute FromBaseType="True".

This is an example of an XML new field node definition which can be edited or deleted programmatically.

Configuring SQL database servers for Sharepoint 3 (MOSS)

I am currently building a 6 server Sharepoint 2007 (MOSS) Farm. All servers are x64 with 2 x Front End Servers, an application server, an Index Server and a SQL2005 2 node cluster connected to an HP SAN. After sizing and designing the MOSS architecture the next step is to configure your SQL server(s). Here is the MS guide for that. Prepare the database servers

Blogger Backups

I keep a lot of information for reference in my blog and felt I'd be more comforatble if I could back it up locally. CodePlex is one example of a new Blogger Backup tool.

(Blogger say you can backup by adjusting the page template to show everything and then saving it, however this doesnt seem a very viable option with a lot of posts)

Other examples of a Blog backup is Lab Asprise’s Blog Collector whilst you could use Httrack to copy the website as a whole.

Marines flex their muscle with SharePoint - Network World

Marines flex their muscle with SharePoint - Network World: - If its good enough for the Marines ......

Monday, May 21, 2007

Updating Sharepoint List schema's using web services

Using Microsofts UpdateList web method from (_vti_bin\lists.asmx) for both WSS2 and MOSS I couldn't figure out why I kept getting a SoapServer.SoapServerException error message (of course without any helpful explanations)

The arguments for UpdateList are :

listService.UpdateList("List_Name", ndProperties, ndNewFields, ndUpdateFields, ndDeleteFields, ndVersion.Value); //where nd is an XML Node.

Although I only wanted to add fields I was still creating all of the root elements of the nd.. parameters and then calling UpdateList only to return a SoapServerException message.
such as: XmlNode ndUpdateFields = xmlDoc.CreateNode(XmlNodeType.Element, "Fields", "") etc..

I then discovered that if I replaced the parameters for the actions I didn't need with nulls then everything sprung into life! - I couldnt find any documentation for this, however I guess thats what blogs are for!

Thus to just add new Fields use the UpdateList command in the form of:
listService.UpdateList("List_Name", ndProperties, ndNewFields, null, null, ndVersion.Value);

Tuesday, May 15, 2007

Web services deployment problems (dotnet 2.0 and VS2005)

It is very easy to write and debug the web service using VS2005, however deploying that web service to IIS has so many issues to trip you up that I'm documenting my experience here so I can remember all of them.

Firstly create your web service - The VS code out of the box will do. ie
New project->Visual C#->ASP.NET Web Service Application

This will give you code similar to the following:
namespace SimpleTestWebService
[WebService(Namespace = "")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service1 : System.Web.Services.WebService
public string HelloWorld()
return "Hello World";

Run this code and envoke the http Post to test all is well.

Now choose File->Add new project->Other Project Types->Setup and Deployment->Web Setup Project

Now Right click on the WebSetup project and choose Add->Project Output

Make sure that the correct WebService project is selected and select Project Output, Debug Symbols & Content Files

Then Build the WebSetup project - (Depending on whether you Build in Debug or Release, it will put its setup.exe and websetup.msi in the same named directory)

Note: you can Install or uninstall the web service from VS by right clicking on the WebSetup project in solution explorer and choosing install/uninstall.

Once I installed the web service to IIS these are the issues I had:

1) Make sure you set your IIS site/virtual directory to use ASP.NET 2.0 if you are using VS2005 - see this post for examples

2) Accessing http://localhost/websetup/service1.asmx gave me the following very unhelpfull error:
Failed to access IIS metabase (see link)
This relates to an error where the local machine ASPNET cannot access the IIS metabase. It can occur where DotNet 2 has been installed after IIS and lots of other combinations.

Workaround: Microsoft published several fixes including using asp_regiis -ga ASPNET, however the best solution I found was to go to control panel-> add/remove programs and choose repair on the DotNet 2.0 install.

3) After the dotnet 2.0 repair succeeded, accessing the web service gave me a new error:

HttpParseException, Could not create type 'Service'. (see link)

The solution seems to be that when the package is deployed to the web server, the bin directory is created but the dll's are put in the directory above. Moving the dll to the bin directory manually seemed to fix this error, however I found a setting in the VS2005 deployment project which corrects this behaviour.

Select the Properties for Primary Output from the WebSetup project. Under the Folder property choose bin. This then seems to put the dll's into the bin directory and the web service works correctly.

Why such a simple thing such as deploying a web service seems to be so difficult is something I very much hope Microsoft is addressing with Orcas, however in the meantime I hope that these notes assist you in not having to struggle quite as much as I did.

Infopath 2007 sequential counters

I needed to create an Infopath form which would create a sequential invoice number. I am publishing the form to a MOSS Forms library and using the browser to edit the form.

Easy, I thought... I'll just connect a second data source to a SQL server stored procedure to give me the next invoice number - BUT this seemed to break the browser compatibility no matter what configuration I tried.

This is the SP code - (crude but effective for what I needed)
ALTER Procedure [dbo].[NextInvoiceNumber]
@NextNumb INT OUT as
update lookup
set NumValue=NumValue+1
where Header='InvNumb'
select @NextNumb=NumValue from lookup where Header ='InvNumb'

So attempt two was to use Web Services. (I am new to these but used to do a lot of COM+ distributed applications 0 so how difficult can it be?). Well it turned out very easy to write and debug the web service using VS2005, however deployment was an absolute nightmare.

Ive documented solutions to all the web service deployment problems I found in this post

Thursday, May 10, 2007

Microsoft SharePoint Products and Technologies Team Blog

Microsoft SharePoint Products and Technologies Team Blog: "Security guidance for an external anonymous access environment is targeted to allow anonymous access to content while protecting back-end servers in the farm from direct user access or malicious actions targeted through front-end Web servers. In an environment where multiple farms might be deployed to support authoring, staging, and publishing, the guidance for this environment is intended for the published farm (the farm that is anonymously accessed by users)."

SharePoint Migration tools

SharePoint Software: Backup, Recovery & Migration for SharePoint by AvePoint

List And Library Migration Manager for SharePoint
...This tool does exactly what it says it does. It moves lists and libraries, including all the meta data columns, to and from both 2003 and 2007

Tzunami Deployer
Quick & easy migration from a multitude of content sources, including SharePoint Portal Server 2001,
Windows SharePoint Services 2003, and SharePoint Portal Server 2003

Drag and Drop emails from Outlook into SharePoint

The Boiler Room - Mark Kruger, SharePoint MVP : 2007 MOSS Resource Links (Microsoft Office SharePoint Server)

The Boiler Room - Mark Kruger, SharePoint MVP : 2007 MOSS Resource Links (Microsoft Office SharePoint Server)

Thursday, May 03, 2007

Sharepoint 2003 to MOSS 2007 Document migration

I need to migrate a number of documents from one sharepoint environmen to another.
One option is to use the Microsoft Spin and Spout Document Library Migration Tools

Another option might be to use the following 2 tools

To download the documents from SPS2003:
All About SharePoint : SharePoint Document Puller v4.0

And to upload them to MOSS 2007 using WSUploadService - A Web Service for uploading documents into SharePoint All About SharePoint : WSUploadService - Web Service for uploading documents into SharePoint

All About SharePoint : SharePoint Document Puller v4.0

All About SharePoint : SharePoint Document Puller v4.0

This tool extracts documents from the SharePoint's DB. It works with SharePoint Portal Server 2003 (and WSS 2.0).

All About SharePoint : WSUploadService - Web Service for uploading documents into SharePoint

All About SharePoint : WSUploadService - Web Service for uploading documents into SharePoint: "WSUploadService "

Wednesday, May 02, 2007