I love my day job
May 2009 - Posts - SharePoint Skater

SharePoint Skater

Custom control and client script aficionado, neck-deep in a simmering SharePoint stew.

May 2009 - Posts

SharePoint Migration from 2003 to 2007: Leave the clutter behind.

This has come up several times recently, and I think it's another case of the "Microsoft offers it so we should use it" mentality.  There are indeed tools and utilities for migrating your existing farm -- or content database(s), or site collection(s) from 2003 to 2007; there are even procedures for upgrading your SharePoint farm to the new version.

Having been all over that mess, I can't recommend it.

In fact, we almost always advise not migrating everything in bulk, in favor of having the users themselves bring over their relevant content.

Here's an analogy:  when you build a new house, you don't build it around the old one and hope everything fits.  You build in a new location (or perhaps the old if you're demolishing first), and then take what you want and place it where it should go in the new house.  Along the way, you discover a lot of things that you don't need; as a result, they get thrown away or given to someone else, and you have less clutter.

Of course there are exceptions, but -- generally speaking -- this approach (a) puts responsibility in the hands of the business users who actually *care* about their content, and (b) doesn't bind you to the old way of doing things.  It's a chance to go forward without the baggage of the past, to cash in on hindsight, to invent new cliches... and it shows you what content people are actually using.

PSConfig revisited: character analysis

After yesterday's brush with covert crazy hyphens, a related tip seems in order.

This isn't the first time I've been burned by non-standard characters.  Several years back I created a small classic ASP utility (yes, it's THAT old) that analyzes a string and spits out the unicode values; you can use it in the iframe below.

As a sample, here are two identical sections of the PSConfig script -- one with proper dashes, and one with the offending content.  You can copy/paste each into the tool below to see how obvious the problem is.

Normal:
Psconfig -cmd configdb -create -server <SQL_servername> -database <precreated_configDB>

Disturbed:
Psconfig –cmd configdb –create –server <SQL_servername> -database <precreated_configDB>

 Alpha characters are shown in blue, with numerics in green.  Normal "extra" characters are yellow/beige, and out-of-range weirdness is highlighted in red.

 

PSConfig: helpful tool, unhelpful error messages

Earlier this week, I needed to set up a MOSS development box.  Piece of cake, right?  Well, I must have been really tired from the long weekend, because when I used PSConfig to pre-create the configuration database, the following error stopped me dead in my tracks:

“The -cmd command is invalid.”

For those of you not familiar with PSConfig.exe, it's a nice little built-in utility that allows you to create your configuration database and admin content database with a pre-determined name instead of the unholy string of nonsense that MOSS autogenerates.  You can run from in the /bin folder under the 12 hive, with the following syntax (all on one line):

Psconfig.exe -cmd configdb -create -server <SQL_Server_Name> -database <New_Config_Database_Name> -user <domain\Database_Access_Account> -password <Database_Access_Password> -admincontentdatabase <New_Admin_Content_Database_Name>

Be sure to replace the angle-bracketed parameters with the correct values.

Normally this works like a charm, and if not, the resulting error message will tell you what needs changing.  In my haste, however, I had copy/pasted the string from a web page and filled in my own values.  The result was that I had some non-standard hyphens, and that made the whole thing choke.  The solution?  Delete all the hyphen (dash) characters and re-type them.  Problem solved.

Posted: May 27 2009, 04:01 PM by PeterBrunone | with no comments
Filed under:
Anonymous users and SharePoint workflows: The Problem

Simply put, you can't trigger a workflow from an anonymous user.  The workflow must run in the context of the current user account, and of course there isn't one when you're anonymous.  If you do try it, you'll probably see the following error:

 The data source control failed to execute the insert command.

This is misleading because the item does get added to the list.  It's the subsequent event (start workflow) that gets confused and curls up in a fetal position while humming manic strains of obscure nursery rhymes.

Since most people seem to think it's impossible to do this, I'm going to give it a try.  Hopefully I'll have some meaningful results to share soon.

SharePoint Designer Gotcha: Where's the "action" in my Form Action button?

It seemed simple enough.

I built a custom New Item form.  Naturally, it needed to redirect to another page after completion.  Normally for a "return page" function, a "Source" parameter in the querystring will suffice, but that didn't seem to work here.  I found the Form Action Button (under Insert->SharePoint Controls->More SharePoint Controls), added Commit and Redirect actions, told it what page to use, and presto!

Nothing happened.

In fact, it didn't even try to submit the form.

A look at the markup revealed that the "Form Action Button" was just a regular old input type="button".  SharePoint Designer was supposed to add an event handler with a JavaScript call, but there appears to be a bug in Designer.  Apparently if there is another HTML button nearby, the event handler can end up there instead!  I've included the code so you know what to look for if this ever happens to you:

  onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={Thanks.aspx}')}"

Your actions may be slightly different, but that's the basic idea.  All you need to do is to cut/paste this bit into your *actual* button -- or any other control, really -- and you'll have the behavior you expected in the first place.

Whew.

Fun with MOSS Search, Part I: Service Packs and Registry Hacks

SharePoint farms can take several forms.  Probably the most common one is the single-server farm (not to be confused with the "Simple Install", which is almost always a very bad idea).  If you're low on hardware -- or you just don't want to shell out for an extra server OS -- you can start out with all of your services on a single box and expand later as needed.

However, there are some roadblocks that will slow you down.  One of the most unexpected is the problem of crawling a SharePoint server from that same server.  If you've tried this recently, you may have gotten this ugly message in your crawl logs:

 Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content. (The item was deleted because it was either not found or the crawler was denied access to it.)

"Why is this happening?" you may ask, after checking to make sure that your default content access account does indeed have access.  If everything else is in order, your problem is most likely something called "loopback checking".  Apparently this is a not-so-new security feature, which prevents anyone from accessing an Integrated Authentication website while logged on to the server itself.

"No problem", you say; "How do I turn it off?"

This is where it gets weird.

The only documented way to disable -- or work around -- this feature is to hack the registry.  The official KB article can be found at http://support.microsoft.com/kb/896861; however, since MS tech info has a way of disappearing over time, I've included a brief overview below.

Open Regedit and add a new Multi-String Value key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0. Name it BackConnectionHostNames; this will be "white list" for domain names that can be explored by the local server.

Once your new key is created, simply add in all of the URLs that your crawler will need to hit on this machine.  Don't add protocols (http, etc); just feed it machine names and domain names as necessary.

That's all the configuration you need.  The KB article tells you to restart the IISAdmin service, but I had to do a full iisreset (remember to run as Administrator) before the changes took effect.

Obviously there should be a better way to deal with this than changing registry values, but you dance with whoever brought you.  Don't forget to add this to your disaster recovery plan; even the farm-level "everything" backup doesn't cover registry entries, so you'll need to keep track of it somewhere else.

SharePoint TechFest: A bit of steak with the sizzle
SharePoint Techfest 2009 was a well-attended event with some good speakers, including Rory Richardson and Joel Oleson.  Joel's talk was an excellent overview of the high points that a good SharePoint implementation needs to hit to be a success.  To date, I've only heard of a handful of those, and the savvy individuals responsible for each were in attendance yesterday.

The high point -- of the sessions I attended -- was SharePoint Search Challenges and Tricks, by my former associate (and MOSS MVP) Matt McDermott.  Aside from the usual (yet pertinent) look at search scopes, custom iFilters, and external content sources, Matt gave us a look at some lesser-known features, like crawling large files outside of SharePoint by using DFS in conjunction with Server Name Mappings.  There was also some great demo integration with the tagging abilities of MS Live Photo Gallery, and of course the usual cameos by his canine companions.

Maybe we'll have a new release to celebrate when we do this again next year!

Posted: May 06 2009, 10:44 PM by PeterBrunone | with no comments
Filed under:
More Posts