stsadm -o export results in an export with no data

December 29th, 2009 by martinnr5

I needed to move a subsite (a blog) to a new farm but when using the stsadm -o export command the resulting backup contained no data.

The exact command I used is:

stsadm -o export -url https://oldserver/isit/blog -versions 4 -filename c:\temp\blog.bak

I tried with the content database in the “ready” as well as the “offline” state. I tried to use -nofilecompression in order to look at the resulting XML and all of them were 1 kb in size.

The blog has 415 entries and when I saved it as a web site template it became roughly 250 Kb so I was sure that the backup file should be more than 1 kb in size.

Finally it dawned upon me: the user I was logged in as didn’t have any access to the site in question. I started cmd.exe as the site collection owner and hey presto, everything worked as it should.

Where does Groove fit in?

January 27th, 2009 by martinnr5

When Groove was aquired by Microsoft way back I was curious about how the had planned to integrate it into their existing information management infrastructure. After reading one of the latest articles on how to integrate Groove 2007 with SharePoint I'm still not convinced.

The gist of it is that Groove can synchronize documents with SharePoint and in the process share these documents with Groove team members that haven't got access to the SharePoint site. To me this is limiting the capabilities of SharePoint as the only thing you use are document libraries.

All the other information – calendar, notes, to do's, etc. – is only found in the Groove workspace. How do I, if I'm external to the team, take part of this information? It would seem as if I have to install Groove and become part of the team in order to do this which might not always be the best solution.

If I don't have access to Groove, is there any way to publish the information to, let's say, the web? If I use SharePoint to collaborate all I need is a web browser in order to access that content. As there are several ways to create external collaboration sites managing users aren't such a big issue after all.

Finally – Outlook already provide off-line capabilities (if, albeit, rubbish ones at times) if you need to take your work with you on the road. It would be logical to assume that Microsoft will improve this in Office 14 (or they've completely lost it).

To me Groove is purely an ad-hoc collaboration tool that you use if you need to keep track of numerous projects spread over numerous organisations and networks.

Or am I missing something?

 

Adding extra content to a list form

December 7th, 2008 by martinnr5

In my current organisation we're going to implement a new issue tracking system when our users needs help with IT-related issues. The idea is that the end users are going to fill out the SharePoint forms themselves instead of calling or e-mailing our support guys whom then have to enter it all into the system anyhow.

As with all organisations we have varying levels of computer knowledge among our users and this means that I need to make sure that even those that are more or less afraid of their computer can fill out the form properly.

Some of my previous attempts have included Flash-based tutorials, guides in PDF-form and hands-on sessions but none of these options are perfect for the job. The tutorial shows how it's done but it's cumbersome to follow it when you need to do it yourself. You can follow the PDF-guide at your own pace but it's still not perfect as you need to switch back and forth between it and the form. Hands-on is always great but it's easy to forget when you need to do it "for real".

This forced me to sit down and figure out a way to add the instructions on how to fill out the form to the actual form. It's not all that tricky and a fair share of people have most likely already done this (and perhaps even blogged about it, I haven't even checked as I wanted to figure it out on my own). Still – here's a short write-up for those of you that wants to give a try.

If you haven't created the list you want to work with you need to do that. The method is the same whatever the form you use (I think, I haven't tried every, single one Smile).

Next, open the list and the NewForm.aspx file (the actual form) in SharePoint Designer 2007:

The NewForm.aspx file in SharePoint Designer 2007

Next up, select the form so that we can locate the table it's encapsulated in:

Select the form

Select the first available TD tag from the left in the breadcrumbs of elements:

Select the TD tag

Insert two new columns to the right of the one we just selected (just repeat the following command twice):

Insert a new column to the right, twice

Click inside the first of the new columns in order to select it. This can be a bit finicky but you should be able to do it:

Select the first column

Right-click the highlighted TD tag in the element breadcrumbs and select "Tag properties":

Select the TD tag properties

Specify it's width to 5 pixels and click OK. This is to separate the help text from the actual form. It can be done in other, more "proper" ways, but this gets the jobe done quite well:

Set the column width

Select the next column and open it's properties. Set the alignments to "Left" and "Top":

Set alignments

Keep the last column selected and insert a new web part zone:

Insert a new web part zone

If you did it right it will look like this:

Web part zone in place

Save your new design (click Yes at the warning):

This one is ok to ignore

Switch to your list in the browser and create a new entry. The page will look exactly the same.

In order to edit it we need to manually invoke the edit mode as described here by Cristophe over at Path to SharePoint. Remove all the crap after "NewForm.aspx" and add "?ToolPaneView=2". In my case that ends up as http://hermes.spirex.se/labb/xform/Lists/Issues/NewForm.aspx?ToolPaneView=2. You should now see the form and the new web part zone we added earlier:

The new web part zone in our form page

Here you can add any kind of web part you like but I would recommend the content editor web part – at least that's what I'm using as it's quite flexible:

The added help section

(In this case the actual help text isn't doing a lot of good though. Smile)

Format the web part to your liking and you might want prevent your users from closing or removing the help as well just to prevent mistakes.

That should get you going but if you have any questions feel free to post them in the comments and I'll do my very best to help you out. Also, if you spot any errors or have ideas on how to do this another way, just hit the comments.

Thanks for reading.

 

– Martin Edelius

One way to present media with SharePoint

December 3rd, 2008 by martinnr5

Mark Miller answered a question over at End User SharePoint on how to manage media files in SharePoint. The gist of the answer is "Don't use SharePoint to store them, just to present them and manage their metadata" – something I agree with as SharePoint isn't a complete replacement for a fileserver (yet).

This got me thinking and I decided to see if I could come up with a way to present the end user with media that:

  1. Didn't require any administrative intervention
  2. Didn't require any editing of pages
  3. Allowed the viewer easy access to the content

As with pretty much anything you do with SharePoint there's always more than one solution to a problem so this is not the way of doing it, just one way of doing it.

I'd also like to point out that this isn't a tutorial or a how-to, just a description of a proof of concept. If anyone needs a more in-depth explanation I'll do my best to write one.

Servers

As mentioned above I don't believe in using SharePoint for bigger files (where "bigger" is 100-200 Mb and upwards) so we need to store the actual content somewhere. I'd also like to give the user a proper streaming "experience" – not just opening media files from a file share and for this I installed Windows Media Services 2008. I'm using Windows Server 2008 and IIS 7 but it should be fine on Windows 2003 and IIS 6 as well.

This leaves management, the presentation and the metadata to SharePoint – something it does really well. I'm using WSS 3.0 but the only real difference to MOSS is that you can get smarter filters and search functionality with MOSS.

The setup

So, Windows Media Services (WMS) and the content go on the same server. I set up WMS so that the default distribution point can serve up any file from a directory. I also share this directory so that users can upload content to it, thus making it available via WMS.

In WSS I create two lists; one document library where I store annotations to the media (could also be slideshows, course material or any sort of additional documentation) and one list to manage, and display, the media.

The Media library list is the interesting one and is set up like this:

The media library list column definition

 

 

 

 

 

 

 

 

Besides Annotations, which is a lookup based on the Annotations document library, there's only one really interesting column here and that's the Media column. This is where it all comes together and the magic that turns the pumkin into a chariot is Christophe's code for "HTML calculated columns". It's a very clever idea and I recommend you all to read his posts on the subject if you already haven't.

What the column does, in short, is that it uses the following code snippet to create the HTML needed to embed the media:

=<DIV><OBJECT id='WMP7' CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'><PARAM NAME='URL' VALUE='mms://media.spirex.se/" & [Filename] & "'><PARAM NAME='AutoStart' VALUE='False'></OBJECT></DIV>

The script from Christophe then makes sure that the above gets rendered properly instead of displayed as you see it above (which SharePoint would do by default).

I also created a view that displays the Media, Annotation and Tags columns, grouping on Media type and then on Title with the groups initially collapsed. This way the media player will only be visible when the users expands the file she wishes to access.

The end result

With the above setup all the user needs to do in order to serve up streaming media via the SharePoint list/site is:

  1. Upload the media to the media server library
  2. Create a new entry in the media library list in SharePoint, using the proper information (filename, tags, annotations, etc):
    Adding a new entry

This fulfills the requirements I set up and lets the various technologies (WMS and WSS respectively) do what they do best.

I have set up a small demonstration site for this but be aware that it runs on my virtual test rig in my closet so if performance goes AWOL, just come back later.

Thanks for reading and please share your thoughts in the comments.

 

– Martin Edelius

A quick note about moving databases in SharePoint

December 3rd, 2008 by martinnr5

If you need to move databases from one server to another and not just from one disk to another on the same server there are some pretty good documentation to be found.

The thing they neglect to mention – or at least the documentation I used (Microsoft official btw) – is that you need to move the search database as well. They just focus on content and configuration databases.

For this one customer I work for this "oversight" resulted in event id 5586 and 6398 with source "Windows SharePoint Services 3" in the application log.

To move your search database start by going to Central administration -> Operations -> Servers in Farm and stop the Search service. You will get a warning about horrible disaster and the end of the world but just click OK.

Now you start the service again and in the next screen enter the information for the new server. If you, like me, have already moved the search database to the new database server you need to either throw it away or use another name in the SharePoint admin interface.

Et voila, your search database is now moved to the new database server.

Don't forget to assign your sites an indexer (as you removed the old one above).

One application to rule them all?

November 15th, 2008 by martinnr5

The company I work for use a number of applications besides SharePoint and we're not sure how to leverage them all.

At the moment we're concentrating on how to handle tasks and in this particular case we also have Microsoft CRM 4, Outlook 2007 and OneNote 2007 to take into consideration.

These are the requirements we have:

  • Each department has it's own area in MOSS with a corresponding task list that a user can have tasks in
  • Each user has his/her personal My Site with a corresponding task list that a user can have tasks in
  • Each project site has a task or project task list that a user can have tasks in
  • There has to be one central location to manage all tasks
  • We use OneNote to take notes in all our meetings, writing down tasks and assigments directly in the meeting notes
  • All tasks must be bi-directionally synchronized to our Windows Mobile 6 smartphones

Now, getting all the tasks from MOSS into Outlook 2007 is a piece of cake – we just connect them to Outlook from MOSS and we're home. It takes some fiddling with the folder structure, naming conventions and the views in Outlook to be able to keep track of hundreds of tasks spread over multiple projects and sites but it's more than doable with a bit of discipline.

Next up is OneNote (a tool I can't live without by now, by the way). Here I'm a bit more uncertain on how to handle things. My current approach is to create the tasks in my local Outlook (if I'm the one taking notes) and after the meeting assign them to the person responsible (I simply include the name of the person respnsible in the task description to keep track of this).

It's not perfect as it requires some hands-on after the meeting to distribute the tasks but I see no way to assign tasks from within OneNote.

As for CRM we're currently on the backburner with it as far as tasks go even though we sooner or later will need to use those as well in order to connect tasks with CRM-entities. Still, as of now it's not a concern so we're leaving them out of the equation to simplyfy things (without ignoring them completely of course).

The smartphones are the roadblock at the moment as I see no way to synchronize anything but my local task folder to them. Not even tasks based on e-mails (or other types of Outlook objects) show up as they "reside" in a mail folder and not the task list – that's the only explanation I can come up with anyhow.

I don't use the phone for tasks at all but one of my colleagues could really use this in order to be as efficient as possible, especially the option to create a task on the phone and put it in the proper SharePoint list right away. I haven't found any way of doing this so if you have any ideas, feel free to post them in the comments.

If you want to know more about how we try to bring some order to chaos also drop a line in the comments and I'll go into more details.

Troubleshooting "Faulting application w3wp.exe", pt 2

October 8th, 2008 by martinnr5

Hello again.

Let us jump right into where we left off, shall we?

When logging on to the SharePoint server this morning I was greeted by a couple of error messages, stating that the IIS worker process had gone nutty. This was actually a source of joy as it meant that the error had been reproduced during the week I've been away from the server.

Looking at the Debug Diag tool lowered my spirits rapidly though as it had caught nothing in it's web. Not even the all-encompassing "All IIS related processes" filter had any info about the crashes.

I took a quick stab at the IISState tool I mentioned in my previous post but that didn't help me as it was more or less a command-line version of Debug Diagnostics. Instead I decided to read up on how to use Debug Diagnostics (I know, I should've done that to begin with but hey, I'm only human).

First off I noticed that there's a version 1.1 of Debug Diagnostics available so I grabbed that one and installed instead (you need to either uninstall the entire IIS Debug Toolkit or just Debug Diagnostics 1.0 in order to install version 1.1).

SearchWindowsServer.com has a nice roundup of links relating to this tool, one of them is a Microsoft KB article entitled How to use the Debug Diagnostics tool to troubleshoot an IIS process that stops unexpectedly, which sounds like something I need to read.

First of all I need to turn off health monitoring in IIS:

  1. Open the IIS MMC snap-in.
  2. Expand Application Pools.
  3. Right-click Application Pools, and then click Properties.
  4. Click the Recycling tab, and then click to clear all the Recycle worker process check boxes.
  5. Click the Performance tab, and then click to clear the Shutdown worker processes after being idle for (time in minutes) check box.
  6. Click the Health tab, click to clear the Enable rapid-fail protection and Enable pinging check boxes, and then click OK.
  7. Restart IIS. To do this, click Start, click Run, type iisreset, and then click OK.

Creating the actual crash rule is not explained in great detail though and the "Select the desired Target Type, and then click Next." line is not at all helpful as it's what type of target I'm unsure of. Unfortunately the aforementioned SearchWindowsServer.com article only tells me how to analyze an existing dump file.

So I'm going with the "A specific process" option and then selecting the w3wp.exe process. Microsoft tells me that after that all I have to do is the classic "Next, Next, Finish" manoeuvre and I gladly comply as I'm not quite sure what the advanced options do.

And yet again we wait for our unsuspecting prey to stumble into our cunning trap…

 

Troubleshooting "Faulting application w3wp.exe", pt 1

October 1st, 2008 by martinnr5

I guess most of you have seen an error reporting dialog for the IIS Worker Process from time to time when you log on to your SharePoint (or IIS) server – I know I have and far too often.

There is not a lot of information on how to properly troubleshoot this but there are a lot of people that wants to know what to do about it. I hope that I will be able to shed some light on this through a series of posts, although I will be posting these as I troubleshoot.

This means that I have no real idea where I will be heading or if I even solve the problem. Then again, it makes for a lot more interesting reading. :)

Searching for information about this mainly returns two links:

The first one is an IIS-generic knowledgebase article on how to set permissions for applications pools but it is of course applicable to WSS/MOSS as well.

Do the following in order to figure out what identity your SharePoint application pool runs as:

  1. Open IIS manager on the SharePoint server
  2. Expand the tree under the server and application pools section
  3. Right click the correct application pool (in my case it's Sharepoint – 80) and select Properties
  4. Select the Identy tab and note down the identity used

I won't go through the KB article but suffice to say that it didn't help me solve the problem as everything already was hunky dory.

The next link above leads to a very comprehensive How-To/philosophical discussion on how to handle application pool related snafus. David Wang has been at Microsoft for five years in the IIS team (if I can read his long winded bio correctly ;) and has put together a very interesting article about how IIS handles processes. Well worth a read, even if it is quite meaty.

Still – there's no real practical information there other than that we need to capture the crash in the wild, so to speak. We can't troubleshoot this error after the fact and he reccommends two applications; IIS State or DebugDiag. I went with DebugDiag myself as it's an official Microsoft tool.

Setting up DebugDiag wasn't entirely straight forward as I didn't want to wade through huge amounts of trace dumps if I could avoid it. This meant that I first created one filter for only the SharePoint – 80 application pool but it seems as if it didn't catch the error (as I did get one in the event viewer during the time DebugDiag was running).

This meant that I set up a new filter – alongside with the old one, just in case – that is meant to catch all IIS related crashes but so far I haven't been able to reproduce the crash.

And here ends this first installment. I know some of you wanted an actual answer but I have to blog it like this or my memory will fade and/or I won't have the time to blog about it at all.

So join me for the next part of the saga, hopefully within a week at the latest.

How do I change the default field in a list?

July 3rd, 2008 by martinnr5

Hi all.

There has been very little SharePoint consulting for me the past six months which means that this blog was left untouched and abandonded. I'm ashamed to say that I only update it now because I need help. :(

When creating a custom list there's always a default text field created. This is, among other things, used as the "anchor point" for a preview type of view (the one where you hover the mouse pointer over an item in the list to the left and you get a preview of the object to the right).

The list I'm creating now has a person/group field as the main identifier and thusly I want it to be the anchor point for the preview view but I can't for the life of me figure out how to do this (perferably w/o too much coding).

Any thoughts/ideas/pointers regarding this?

TIA!

Deciphering the User Properties "move" javascript controls

December 13th, 2007 by martinnr5

Ok, one of the worst subject lines ever, I know, but I'm not sure what to put there.

Anyhow, the controls I'm talking about are the ones you use in the MOSS managment web site (this one I'm sure isn't in WSS as it's part of the SSP) after you add a custom property. Those of you that have done this know that in order to move the new property all the way from the bottom to where you need it (in order to get your "Details" page to look as you intended) you click one of two arrows. It's one arrow for up and another for down, both have a snippet of Javascript attached to it.

I was getting fed up with having to click the up arrow 35 times in order to move my new property to the correct position so I thought I'd hack the Javascript snippet. It didn't do any good but I though I'd share my findings – albeit minor – with you.

This is the code (sanitized for publishing) for moving the property at position 43 to position 42: javascript ProcessProperty('ctl00$PlaceHolderMain$MgrProperty1_N_43','False','MoveUp','ctl00$PlaceHolderMain$MgrProperty1_U42')

To me it looked like I can replace "U42" with "U14" and have it jump from 43 to 14. No such luck.

The first variable, 'ctl00$PlaceHolderMain$MgrProperty1_N_43', indicates at which position the property you want to move exists. This means that we can't re-use the same link over and over again in order to move the property – it points to a position in the list and not a specific property.

I'm not sure about the second variable so feel free to fill me in if you know anything about it. The third one is pretty self-explanatory – it says "MoveDown" for the down snippet.

Now, the final variable is the most confusing one as one would assume that it tells the script where to move the property. Then again, why would there be a need for the "MoveUp" variable if you could tell the snippet to move between two positions? Huh, didn't think about that did you? Me neither, until just now. :)

So what it does is tell SharePoint where to put the focus when it reloads the page. As you move the property one step up it's logical to focus on the next position in the list. If I replace 42 with 14 all that happens is that the page reloads with focus on the property at position 14 in the list.

So, here's my tip to the SharePoint team at Microsoft; make the code snippet move from position A to position B and skip the direction altogether. This way I, the power user, can hijack it and tell it to move the property at position 42 to position 14 in one fell swoop.

Thoughts?