The Great Flood of 2012

My house flooded last Thursday night.  We’ve had a little water come in once before which pooled in the laundry and kitchen and that’s how it started on Thursday.  I did the normal thing, which was to stuff towels under the back and side doors and across the kitchen doorway.  Two hours later I came downstairs and there was enough water in the hallway to cover my feet.

Flooded Kitchen
What’s wrong with this picture? The blue towel was across the doorway to stop water running in the red mat should be in front of the bathroom door and the fridge power lead should be on top of the red ice bucket.

Things weren’t much better in the hallway:

I took these photos after unplugging everything that was underwater, fishing out the vacuum cleaner and leaving it to drain and sorting out anything else that was going to get wrecked by immersion.

Being radical and unconventional, our bathroom doesn’t have a drainage plug in the floor, it’s got a hole in the wall at floor level.  This has the benefits of poorly draining water from your shower, making the bathroom a bugger to keep clean, but also means that when it floods the water has an easy entry to the house.  Guess what I forgot to plug.

I can tell you that it’s pretty weird having a shower ankle deep in floodwater.

The living room, the highest and most expensive part of the house was also innundated.  You can’t really see it from this photo, but the water’s up around the castors of that office chair.  You may notice the eerie mirrored surface of the floor.

Astute observers will notice the odd perspective presented by the fan. It’s actually on the chair to keep it out of the water.

Now let’s have a look outside.  My yard  has been flooded pretty much continuously since it’s started seriously raining.  It’s been kind of weird washing paint brushes with the hose ankle deep in muddy water.

That can’t be good for the grass.
Someone leave the hose running?
The watering can is bitterly ironic, given the circumstances.
Duncan will be disappointed.
No chilling in the little deckchair tonight, unless I put my feet up too.
The water level has dropped by about half now, it was over the step at its height.



So in the end not much damage was done, although there’s been a lot of cleanup of floating garbage and the like.  I’ve got some sandbags so we’ll see how things fare next time.

Take a Walk through your SharePoint Farm

When tasked with upgrading our long-neglected ‘intranet’ last year my first job was to work out just how much data was out there and what needed to be upgraded.

The masterpage had been butchered some time in the past so most of the pages were missing navigation, making it hard to follow sites down the hierarchy.  And what a hierarchy!  The architects of the original instance apparently worked out that you could have more than one document library per site, or that you could create folders.  The result is the typical site sprawl.  To add to the fun, some sites were created using some custom template that no longer works and others didn’t have any files at all in them.

In order to create a list of all the sites and how they relate, you can use a PowerShell script:

[code lang=”PowerShell”]

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null

function global:Get-SPSite($url){
return new-Object Microsoft.SharePoint.SPSite($url)
}

function Enumerate-Sites($website){
foreach($web in $website.getsubwebsforcurrentuser()){
[string]$web.ID+";"+[string]$web.ParentWeb.ID+";"+$web.title+";"+$web.url
Enumerate-Sites $web
$web.dispose()
}
$website.dispose()
}

#Change these variables to your site URL and list name
$siteColletion = Get-SPSite(http://example.org)

$start = $siteColletion.rootweb

Enumerate-Sites $start
$start.Dispose()
[/code]

It’s actually pretty simple since we take advantage of recursion.  Pretty much a matter of getting a handle to the site collection, outputting its GUID and parent site GUID and then the human-readable title and URL.  They you do the same for that site, and so on down the branch.

The reason we’re outputting the GUIDs is that we can use them to relate each site to the rest.  The script outputs straight to the console but if you pipe the output to a text file you can use it for the input to a org-chart diagram in visio.  The results are terrifying:

image

Each node on that diagram is a site that may have one, or thousands of documents.  Or nothing.  Or the site just may not work.  As it turned out, when asked to prioritize material for migration, the stakeholders decided it would be easier just to move the day-to-day stuff and leave the old farm going as an ‘archive’.  Nothing like asking a client to do work to get your scope reduced!

As a final note on this script, it is recursive so could (according to my first-year Comp. Sci. lecturer) theoretically balloon out of control and consume all the resources in the visible universe, before collapsing into an ultradense back hole and crashing your server in the process, but you’d have to have a very elaborate tree structure for that to happen, in which case you’d probably want to partition it off into separate site collections anyway.