Monthly Archives: June 2012

10 things I love about Windows 8 (Release Preview)

This follows on from my post earlier this week titled 5 Little things that are annoying me about Windows 8 (Release Preview).

So for balance I am talking positive and talking about the features and options in Windows 8 that really make that upgrade worthwhile (or at least things where you go .. “cool!”).

I am very much ignoring features like “file history” as this is really an existing feature (Previous Versions) with a different name. So .. in no particular order … here are my top 10 ..

#1 Updated Task Manager

This is one area of Windows needing a facelift for quite some time now, and this version has several improvements.

The most noticeable part is that the standard “Process” screen has been uplifted. The columns are simplified and show a colour-coded representation of how much strain they are putting on your system (they turn yellow, orange and eventually red if they start causing a bottleneck and maxing out your system).

The “Performance” screen looks pretty similar, but the graphs have been given a bit of a facelift and now show a neat real-time graph for each component, while showing the detailed view in the main window.

Equally cool is the network information which shows you traffic (upload / download) for your network connections.

There is also a very cool “App History” tab which shows you how much CPU time (hours / minutes / seconds) and how much network resources your apps have consumed.

This not only gives you an insight to how much you use your apps (useful for those you have paid for!) but also which ones are using your all important network bandwidth (which will be incredibly useful for those on 3G or tariff network connections).

#2 Updated file transfer dialog

Windows explorer has also had a facelift, but the one I like the most is the file transfer dialog. The main change here is a graph showing you the history of the file transfer speed. These also stack so if you have multiple files being transferred they are all docked into the same window!

#3 Natively mount ISO images

This is one I’ve been waiting for, and always used to end up installing some third party ISO app (such as “MagicISO”.

Now you can just right-click on your ISO image and select “Mount” at which point it appears as a drive letter. This is great for downloading and installing tools and apps from MSDN or digital download sites. Most of my VMs use mounted ISOs as well so I can use the same ISO for both! 🙂

Easily right click on an ISO to mount it

And it appears as a new Drive Letter 🙂

#4 Hyper-V and Native VHD Mounting

Another brilliant add on (and “finally” moment). Virtual PC really was terrible and I have always stuck to VMware Workstation.

Now they have brought together the full Server 2012 Hyper-V experience to Windows 8 and much missed it has been (you simply have to add “Hyper -V” as one of the selectable “Windows Features” and off you go!)

Along with this you also get VHD (Virtual Hard Disk) mounting too, which is the native format used for Hyper-V. This works in the same way as ISO images described above. I love this feature as it means you can check the contents of your VM even if the machine is turned off (so you don’t need to waste CPU / RAM / boot time to get a couple of files from it).

#5 Storage Spaces .. hot expandable software RAID?

This is a great alternative to using RAID setup. It basically creates a mirrored array using a new distributed file system where you have two or more physical drives. They don’t have to be identical drives (although similar performance will certainly help matters!).

Windows will then split files across both drives so it can recover the contents when one of your drives fails, a particular gotcha it seems for people with a history of failing HDD or SSD (Chris O’Brien .. I really hope you are reading this!)

The best thing about this “Storage Pool” is that you can expand it on-the-fly with additional drive storage, so if you get another hard drive you just plug in your partition and off it goes.

Mainly I can see this being useful for full desktop workstations (with multiple drive bays) or people using Windows 8 for their home entertainment / NAS replacement. When your storage gets a little low just slap in another drive and off it goes 🙂

Note – it was a bit hard to find, right-click on the bottom right to get to Control Panel, and its under “System and Security”

#6 Lock Screen and Live Tiles

Well lets face it, I couldn’t really get away without mentioned the Lock Screen and the Live Tiles functionality. I’ve had a Windows Phone for a couple of years now and I do really like the Lock Screen notifications (although I admit I don’t really use Live Tiles on Windows 8 .. but I can see this being awesome for people who live in Metro, especially touch-screen tablets and Windows 8 RT environments).

The lock screen in particular, showing up Metro Apps (and you can configure which ones can post updates .. if any!). In particular I have two Mail accounts (Hotmail and Exchange) so I can see “at a glance” without even logging back in whether or not I have any new emails or messages.

#7 Fully Integrated Search

Another item that some of us have been crying out for. You can now search pretty much everything from one place. Can’t find it in your Apps? check the App Store, or check your file system, or even check.

The search has a nice internet-driven auto-complete, and switching from one search to another is a breeze. If the app you are using also has search capabilities then that filter will be automatically selected for you.

Search loads from the right-pinned “Charms” bar so your main window is still visible

#8 Login using Microsoft Account

I have to admit I was a little sceptical about this first off, but the more I’ve been using it the better I have found it. This basically allows you to login to your machine using a “Microsoft Account” (which for most of you will be a Live account which you use for Hotmail or SkyDrive).

The most obvious benefits when you first login is that it automatically configures a bunch of stuff for you:

  • Account picture automatically pulled from your online Live profile
  • Mail App automatically includes your Hotmail Account
  • SkyDrive app is pre-configured for your online SkyDrive folders
  • People and Messaging hubs automatically sync with any “Live Connected” accounts such as Twitter and Facebook
  • Photo app automatically pulls content from SkyDrive / Facebook / etc

So a lot of the initial setup pain is already taken care of. This gets even better though when you look at “Sync Settings”  .. which seamlessly syncs to “the cloud”.

This includes a whole bunch of stuff such as:

  • Colours, backgrounds and themes
  • Browser settings, favourites and history
  • Language, Keyboard and input preferences
  • App settings and purchase history

It can even sync your passwords, although it does limit you to only doing this from a “Trusted PC” (which requires you to setup your “Trusted Device” using Live Essentials and configuring it through your Live Account settings).

#9 “Save to Microsoft Account” for BitLocker keys

For those who don’t know BitLocker is a drive encryption tool (which through recent enhancement now rivals TrueCrypt for performance and encryption capabilities). The premise is that your drive contents are encrypted, requiring a password for key token to “unlock” the drive on boot. This stops people from booting to another OS using a memory stick, or simply taking out your hard drive and putting it in another computer (thus bypassing any of the Operating System or NTFS permissions).

The main issue with BitLocker is if you need to move your hard drive or re-install Windows you can’t access the drive without a Recovery Key (a complex long-text string). Normally you would put this on a backup drive or memory stick to keep safe, but this always seemed a little “amateur” for me.

Well, Windows 8 now supports automatically backing up your key using your Microsoft Account! 🙂

This was a nice surprise which I really wasn’t expecting. I ended up removing BitLocker from my Windows 8 machine because the Release Preview clearly has some bugs in it and the disk performance was about 50% lower when turned on (and hardly noticeable at all in Windows 7) so a few IO issues to iron out, but definitely showing promise!

#10 Metered Network Support and Airplane Mode

To be honest, this was a must for any truly “mobile” device and I’m including both laptops and tablets here. Airplane mode is a simple one (instantly disables ALL wireless connectivity, including 3G/4G and Bluetooth). You can access this from the Network Connections side-bar (by clicking on your network icon in the system tray in Desktop Mode, or accessing the “Network” option from the Settings “Charms” menu.

This is a great companion for “Metered Connections” which allows Windows 8 to know if you are on a connection for which you get charged “per MB”.

This has several angles. First, when you setup a new connection (such as a WiFi hotspot) you can mark it as being a “Metered Connection”.

Once the connection is known as being “Metered” then all sorts of options start coming into play. There have been some telling signs in some of the other screenshots, but I’ve noticed this in a bunch of places which I will list out here:

  • Task Manager’s “App History” shows you how much network traffic has been sent over metered connections by each app you have installed
  • Sync Settings allows you to control whether you sync “over metered connections” to try and limit traffic when you are on a limited network connection (default no)
  • Device Manager allows you to configure whether to download “Device Software and Drivers” over metered connections or not (default no)

I’m sure there will be others (and I’ve probably missed a few) but the good news is that Metered Connections are front and centre!

..

So that’s all for now .. bear in mind this is just the Release Preview (build 8400) of Windows 8 so some things are bound to change and get switched about by the time the final commercial release comes around.

Anything you love about Windows 8 which I’ve not mentioned?? Please let me know in the comments 🙂

5 Little things that are annoying me about Windows 8 (Release Preview)

So Well, last week I took the plunge and got Windows 8 Release Preview (Build 8400) installed on my laptop. And so far the experience has been pretty good (very stable, very fast and no major glitches so far).

However, there are a few things that are annoying me (and if anyone knows me .. they know that its all these little things that REALLY annoy me).

[UPDATE – Please also see comparison post : 10 things I love about Windows 8 :)]

I know .. I know .. this is a release PREVIEW so it is really still in beta and a lot of things can change .. but there are some obvious flaws coming to the surface here, so without further ado, my list of..

Windows 8 (Release Preview) Pet Peeves

#1 Metro and the Taskbar

Now .. I have to admit I’m quite a fan of Metro. I have a Windows Phone 7.5 device (Nokia Lumia 800) and the metro interface is a very vibrant, quick, easy and (above all else) FUNCTIONAL interface.

However, there are some major annoyances that I’m finding impact on my day to day work, and the main one is that Metro Apps don’t appear in the Desktop Taskbar.

Now .. this might not be as bad as you think, but I spend a LOT of my working day in the Desktop mode (and therefore I have a lot of shortcuts pinned to the task bar) and like to use it for quick unobtrusive productivity notifications such as;

  • You’ve had some emails
  • Someone has started/posted to an instant chat
  • Your file has downloaded
  • Your application needs to tell you about something (i.e. it is flashing)

All of these happen at the bottom of the screen and don’t really “get in the way” .. the best bit is being able to “pin” favourite folders / tools / whatever into the taskbar button itself.

However .. a lot of default functionality runs as “Metro Apps” and the problem with Metro Apps is that they don’t run in the task bar. They go full-screen and you lose all of that notification information I described above… so far these apps include:

  • Mail (i.e. Email .. which is exactly why I don’t use it and instead use Outlook 2010)
  • Windows Reader (especially for PDF documents!)
  • Video
  • Music (although this will admittedly run in the background)

So .. just to be clear … you cannot watch a video using the Metro App while also keeping an eye on other “running apps” (such as downloads, several instant chat and email at the same time). Yes .. you can “pin” the other apps left and right .. but I don’t really want them there ALL THE TIME .. I just want to know if they are doing anything worth my attention.

#2 How the hell do you “close” a Metro App?

Yes yes .. I know .. you aren’t SUPPOSED to close them. The beauty of a Metro App is that it saves it’s state and consumes 0% CPU while it isn’t active onscreen (with a few exceptions .. such as music).

This is based on the model used for Windows Phone 7 where you don’t really need “multi-threaded” apps because for most productivity apps they aren’t doing anything if they aren’t in focus.

However … the biggest problem is that they appear in the Alt-TAB “App Switching” dialog…

In the screenshot above the Taskbar shows one program running (IE10) but there are a whole bunch of Metro Apps running in the background (including another IE10 instance in Metro)

This is going to confuse the shit out of end users ..

Now admittedly I’m thinking of my dad and my sister here.. but when you combine this fact with the apparent inability to CLOSE a Metro App ?? and you have a bit of a problem (especially with the “always on” mentality of the modern Tablet / Ultra-book device that never gets rebooted).

You can actually close them fine using the old Windows shortcut keys Alt-F4 but what percentage of the average user base knows this? (outside of developers, IT admins, tech geeks and power users??) .. I’m guess under 20% ..

#3 Move my mouse where??

Ok .. the removal of the Start Menu I could kind of stomach. I get where they are going with this and I know they want to get everyone using the new interface … but they REALLY need to put a tutorial in this for their commercial release..

The “gestures” (for want of a better word) for the main operational menus (as far as I can tell) are as follows:

  • Bottom-Left Corner, Left Click – Start Screen (yes .. the Metro one)
  • Bottom-Left Corner, Right Click – System Tools (for want of a better word .. access to Control Panel, Computer Management and such)
  • Bottom-Left Corner, move cursor up – App Switching Panel
  • Top-Left Corner, Left Click – cycle through currently running apps
  • Top-Left Corner, move cursor down – App Switching Panel
  • Top-Right Corner, move cursor down – “Charm Bar” (access to Search, Share, Start, Devices and Settings)
  • Bottom-Right Corner, move cursor up – “Charms Bar”

Now .. you can add to this list what you would “normally” find in a Windows environment

  • Bottom-Right Corner of Desktop View – Show Desktop button (which still works .. if the Charms Bar doesn’t get in the way)
  • Top-Left Corner – File Menu (when the app-switching button doesn’t get in the way)
  • Top-Right Corner – Close / Minimise buttons (when the Charms bar doesn’t get in the way)

So I really have 2 issues here. There being a lot of different (completely opposite) places to move my cursor around .. and …

How the hell am I supposed to know this ??

I’ve also got some screenshots to show you what some of this looks like..

First you move the mouse cursor bottom-left and the small slightly nasty looking “Start Screen” graphic appears (yes .. the fact that it shows the size and location of your ACTUAL pinned apps is kinda cool .. but it still looks like a Tetris puzzle from the 90’s!)

You then move your cursor “up a bit” and the “task switching” bar appears …

Similar experience for the “Charms” bar .. you move the cursor top-right (or bottom-right) to get it to show (with white icons and transparent background)

Then move cursor down a bit (or up) and the actual charms bar pins in for interactivity ..
The actual experience (once you’ve worked out what you are doing) is ok (and I’m sure in 5 years time I’ll swear its the best part of the interface) .. but expecting people to just “get” this ??
I see a lot of people struggling (especially the less technically literate!)

#4 Metro – Settings, Options and Menus – Keeping you on your toes!

This is a bit of a wail and complaint about the new Metro App interface and how they deal with things like settings, options, menus and the like.
When Windows 3.1 came out they provided a standard way of providing menus (and pretty much every single application for the next 20 years was using the good old File, Edit, View, Tools, Help menu bar). Didn’t really matter what you were using .. you knew where to look and generally where you would find it (apart from idiots who put Options / Preferences under the “Edit” menu).
However in Metro the interface seems to be a bit all over the place. You never really know where you are supposed to be looking, or how you are supposed to get there.
My new expectation is that if you right-click you get the menu bar popping up (NO idea how you’d do this with a touch-screen device .. if someone wants to tell me?)
Examples:
  • Start Screen – Bottom Right
  • IE10 – All 4 corners (although click on “Add Tab” in the top panel .. new option panel for pages appears … at the bottom !!)
  • Weather – Top Left, Bottom Left and Bottom Right
  • Mail – Bottom Right
  • Maps – Bottom Right
  • Windows Store – Top Left
  • Photos – Bottom Right
  • SkyDrive – Bottom Right
  • Calendar – Bottom Left and Bottom Right
  • Video – Bottom Right
  • News – Top Left
  • Sport – Top Left
  • Wikipedia (3rd Party App) – Bottom Left
I hope you can appreciate I don’t really know where to expect to find things .. and my eye is constantly switching from top to bottom, left to right. To make this worse I can see 3rd party apps using different icons for the same thing … or the potential for worse .. the same icon for something else!! (I can see this getting MUCH MUCH worse as the Windows Store starts filling up).
Does this make it “unusable”?? not at all .. I just find it annoying.
I’m hoping that once the commercial version comes out there is some form of “standard” for layout of options and menus. I think part of the problem is that the “touch screen” friendly interface means you don’t have very much room, which is why IE10 (one of the most functional “toolbar heavy” apps you’d want to use on a touchscreen device) has to resort to using all 4 corners of the screen.

#5 Metro .. or Desktop .. ?

This is my final frustration, and I’ve already found probably 3 major apps which I use every single day .. but can’t see myself ever really using the Metro App versions;
  • Web Browser
  • E-Mail
  • Twitter / Social
And this harks back to the problems with the Task Bar (Pet Peeve #1 and not being able to close them, Pet Peeve #2).
The problem is this:
  • Only Metro Apps will post statuses to the Lock Screen (like Music / Messaging / Weather / Email .. very very similar to Windows Phone 7 experience!)
  • Only Metro Apps support Live Tiles
However (as previously discussed)
  • Metro Apps always run full screen
  • Metro Apps are “touch” oriented and feel clunky with keyboard & mouse
  • Metro Apps don’t appear in the Task Bar!
So I’ve found myself configuring a Metro App like Mail (to get Live Tile / Lock Screen) but never actually running it! I just jump over to the Desktop and fire up Outlook instead (although I’ve very keen to see what the next “Metro” version of Outlook is like!)
But certainly my biggest issue is the separation between Metro and Desktop

I have basically replicated my Start Screen in the Task Bar

This just feels plain wrong .. why am I doing this twice? I never really felt the need to do this before (because the Desktop was everything, and the Start Menu was just a place to store the shortcuts for things “I use but not very often”) but now I almost feel like I have two computers.

To make things worse you can’t set an easy “default” app either for both environments. If you are in the Metro interface and click on a URL it will open the Metro Web Browser. It doesn’t prompt you, and I can’t work out how to override this to go to Desktop either.

Why is this important?? Well .. the Metro app doesn’t have the same favourites as the desktop app! (yep .. they are as far as I can tell completely independent!)

And I can see the same kinds of things happening. If I click “New Mail” is it going to force me to use the Metro “Mail” app or can I have it auto-prompt to the desktop “Outlook” instead? And if so .. how would I configure this?

Summary …

I think at the end of the day I can sum up my Pet Peeves on Windows 8 with this:

Desktop Workstation

My laptop is basically a desktop workstation. I want to use Desktop mode .. all the time. Do I like the some of the new features of Windows 8 ??? hell yes.. the new Security features, system recovery, awesome boot times, new task manager, windows explorer functions, ISO mounting and Hyper-V integration are almost worth the upgrade alone!

Do I like some of the new Metro Features?? Hell yes …. I love the Live Tiles .. I love the lock-screen updates and the interface is pretty neat and slick  … Will I actually use any Metro Applications?? No … I will avoid them like the plague (for reasons well stated here).

My parting shot … I am a Microsoft guy through and through. If you cut me in half it probably says “Windows” in there somewhere (and definitely says “SharePoint”) and these are peeves I am prepared to live with .. but will everyone else? I see a lot of new users struggling (a LOT) and I can see businesses very rapidly choosing to NOT deploy this.

I really hope Windows 8 is a success and I don’t think it will bomb like Windows Vista did (this doesn’t have any of the performance / compatibility issues that Vista did) .. but with some of these niggling things I think it might be a bit of a damp squib.

Search Core Results Web Part with Dynamic Date and User Profile Tokens

If you just want the goodies then you can get them here:

The Big Fat Disclaimer – This has not been thoroughly tested for a production environment. I have also removed references in my snippets below to caching and error handling to try and keep it brief. The downloadable version uses both caching and error handling, but it is still really just a proof of concept and you should TEST it before you deploy it! I take no responsibility if your production servers blow up!

I must have seen this requirement dozen of times on different projects, having search results which either:

  • Filter using a User Profile Property of the current user
  • Filter using a dynamic date range (e.g. using the “TODAY” token)
  • Specify the Sort-By (which is normally restricted to either “Relevance” or “Modified Date”

The requirement for functionality of this nature come up extremely frequently on Intranet projects. For example:

“Show News Articles from the past 7 days which filter based on the user’s location”
“Show events coming up in the next 3 months”
“Show discussions / wiki entries / blog posts which include the current user’s Ask Me About values”

Example
image
FixedQuery used in the Web Part:
Author:[UPP-PreferredName] AND Write:[TODAY-180]..[TODAY] AND ContentType:Event

Well .. on my current client project these very requirements came up .. so this time I decided to knock together the basics of the web part in my spare time and then “donate” it to the project… and this post describes how I built it, what goes on under the hood, and also includes both the source code as well as a downloadable WSP package with the working Web Part in it.

Step 1 – Extending the Search Core Results Web Part
So .. to get us started, lets kick off by creating our actual Web Part. I am going to be extending the Search CoreResultsWebPart (link to MSDN).
This is easy enough to achieve by simply creating a new Web Part in Visual Studio and inheriting from the CoreResultsWebPart class. This will make sure our web part gets all of the functionality and properties that the normal Search Results web part does without any additional effort.

   1:  [ToolboxItemAttribute(false)]
   2:  public class ExtendedSearchWebPart : CoreResultsWebPart
   3:  {
   4:   
   5:  }

That is the easy bit …

Step 2 – Overriding the Query and SortOrder
Now the next bit to tackle is how to override the actual query that gets executed. Well the best place to do this is to override the ConfigureDataSourceProperties method. This method gets called before the query is actually executed against the Search engine itself.

You can then leverage the CoreResultsWebPart.DataSource property (which is of type CoreResultsDataSource). This is what allows all of the magic to happen.

   1:  protected override void ConfigureDataSourceProperties()
   2:  {
   3:      // only perform actions when we are trying to show search results
   4:      // i.e. not when you're in Design Mode
   5:      if (this.ShowSearchResults)
   6:      {
   7:          // call the base web part method
   8:          base.ConfigureDataSourceProperties();
   9:   
  10:          // get the data source object
  11:          CoreResultsDatasource dataSource = this.DataSource as CoreResultsDatasource;
  12:   
  13:          // override the query being executed
  14:          dataSource.Query = "Author:\"Martin Hatch\"";
  15:   
  16:          // remove the original sort order
  17:          dataSource.SortOrder.Clear();
  18:          dataSource.SortOrder.Add("Title", Microsoft.Office.Server.Search.Query.SortDirection.Ascending);
  19:      }
  20:  }

So lets talk through the code above.

First off we want to make sure we are only executing our custom code when we are actually trying to retrieve search results. This is a fail-safe block as some instances this will be false (such as when you are editing the web part or if you are viewing the “Design” view in SharePoint Designer). We also need to call the base method (as you typically would when overriding a method call!).

Then things get interesting. Line 11 has us create our “CoreResultsDataSource” object from the local “DataSource” property. This has two properties which we are modifying:

Query (line 14) – This allows us to change or completely override the query which is being executed. This will be the entire query including the Fixed Query, Appended Query and whatever the user typed into their search box (if you are using this on a Search Results page). In my example above I am simply overriding the result so that it just searches for items created by “Martin Hatch” (me!)

SortOrder (lines 17 and 18) – This allows us to override the sort order, allowing us to select ANY indexed Search Property you want (I expect excluding rich text fields of course!). In my example, I am sorting by Title in Ascending order.
This can then be easily extended to provide custom Web Part properties to allow the Sort functionality to be specified by the page editor.

Step 3 – Making it re-usable Part 1 – Dynamic Date ranges
 So now that we can override the query easily we can move on to adding some of the good stuff. I decided to go with a relatively simple Token Replacement function using a simple [TODAY] token to represent the current date:

  • [TODAY] (todays date)
  • [TODAY+7] (today plus 7 days)
  • [TODAY-7] (today minus 7 days)

So .. how do we code this in? Well .. I am quite lazy and don’t really get on with regular expressions (if you are reading this and you are a RegEx guru.. by all means download the source code, refactor it and send it back, cheers!).

So I started off by creating a bunch of class level constants which I would use to recognise the tokens that we are looking for above:

private const string TODAY_PLACEHOLDER = "[TODAY]";
private const string TODAY_ADD_STARTSTRING = "[TODAY+";
private const string TODAY_SUBTRACT_STARTSTRING = "[TODAY-";
private const string TOKEN_ENDSTRING = "]";

The following code can then be swapped out for our ConfigureDataSourceProperties method.

   1:  protected override void ConfigureDataSourceProperties()
   2:  {
   3:      // only perform actions when we are trying to show search results
   4:      // i.e. not when you're in Design Mode
   5:      if (this.ShowSearchResults)
   6:      {
   7:          // call the base web part method
   8:          base.ConfigureDataSourceProperties();
   9:   
  10:          // get the data source object
  11:          CoreResultsDatasource dataSource = this.DataSource as CoreResultsDatasource;
  12:   
  13:          // get the current Fixed Query value from the web part
  14:          string strQuery = this.FixedQuery;
  15:   
  16:          // swap out the exact "today" date
  17:          if (strQuery.IndexOf(TODAY_PLACEHOLDER) != -1)
  18:          {
  19:              strQuery = strQuery.Replace(TODAY_PLACEHOLDER, DateTime.UtcNow.ToShortDateString());
  20:          }
  21:   
  22:          // perform all of the "Add Days" calculations
  23:          while (strQuery.IndexOf(TODAY_ADD_STARTSTRING) != -1)
  24:          {
  25:              strQuery = CalculateQueryDates(strQuery, TODAY_ADD_STARTSTRING, true);
  26:          }
  27:   
  28:          // perform all of the "Remove Days" calculations
  29:          while (strQuery.IndexOf(TODAY_SUBTRACT_STARTSTRING) != -1)
  30:          {
  31:              strQuery = CalculateQueryDates(strQuery, TODAY_SUBTRACT_STARTSTRING, false);
  32:          }
  33:   
  34:          // swap out the Fixed Query for our Calculated Query
  35:          dataSource.Query = dataSource.Query.Replace(this.FixedQuery, strQuery);
  36:      }
  37:  }

This then calls the CalculateQueryDates support method which I put together:

   1:  private static string CalculateQueryDates(string strQuery, string startStringToLookFor, bool AddDays)
   2:  {
   3:      try
   4:      {
   5:          // get the index of the first time this string appears
   6:          int firstIndex = strQuery.IndexOf(startStringToLookFor);
   7:   
   8:          // get the text which appears BEFORE this bit
   9:          string startString = strQuery.Substring(0, firstIndex);
  10:   
  11:          // get the text which appears AFTER this bit
  12:          string trailingString = strQuery.Substring(firstIndex);
  13:          int endIndex = trailingString.IndexOf(TOKEN_ENDSTRING);
  14:          if (endIndex + 1 == trailingString.Length)
  15:          {
  16:              // there is nothing else after this
  17:              trailingString = "";
  18:          }
  19:          else
  20:          {
  21:              trailingString = trailingString.Substring(endIndex +1);
  22:          }
  23:   
  24:          // find the number of days
  25:          string strDays = strQuery.Substring(firstIndex + startStringToLookFor.Length);
  26:          strDays = strDays.Substring(0, strDays.IndexOf(TOKEN_ENDSTRING));
  27:          int days = int.Parse(strDays);
  28:   
  29:          // re-construct the query afterwards
  30:          if (AddDays)
  31:          {
  32:              strQuery = startString + DateTime.UtcNow.AddDays(days).ToShortDateString() + trailingString;
  33:          }
  34:          else
  35:          {
  36:              // subtract days
  37:              strQuery = startString + DateTime.UtcNow.AddDays(0 - days).ToShortDateString() + trailingString;
  38:          }
  39:   
  40:          return strQuery;
  41:      }
  42:      catch (FormatException ex)
  43:      {
  44:          throw new FormatException("The format of the [TODAY] string is invalid", ex);
  45:      }
  46:      catch (ArgumentNullException ex)
  47:      {
  48:          throw new FormatException("The format of the [TODAY] string is invalid. Could not convert the days value to an integer.", ex);
  49:      }
  50:  }

So you should be able to see we are using simple String.IndexOf() method calls to find out if our Tokens are present.

If they are then we simply calculate the DateTime value based on the static DateTime.UtcNow property and use String.Replace() methods to swap out these into our query text.

When we are using [TODAY+X] or [TODAY-X] we simply use DateTime.UtcNow.AddDays(X) or DateTime.UtcNow.AddDays(0-X) and use the same String.Replace() method.

The search syntax is exactly the same as it was previously, and the Keyword Syntax is very powerful.

Example: Using [TODAY] Token query syntax

Write:[TODAY] – this will return all items that were modified today
Write>[TODAY-7] – this will return all items that were modified in the past week
Write:[TODAY-14]..[TODAY-7] – this will return all items that were modified between 2 weeks ago and 1 week ago

So we already have a powerful and reusable search component .. but there is more!

Step 4 – Making it re-usable Part 2 – Dynamic User Profile Properties
The next one is to allow us to pull in User Profile Properties so that we can start doing searches based on the current user’s profile values.
For this we needed to create new replacable Tokens, for which I decided to use:

  • [UPP-{User Profile Property Internal Name}]
  • [UPP-PreferredName] (swaps out for the users name)
  • [UPP-SPS-Responsibility] (swaps out for their “Ask Me About” values)
  • etc ..

So .. we add another class level constant (same as we did for our DateTime tokens)

private const string USER_PROFILE_PROP_STARTSTRING = "[UPP-";

We can then use this in our code, in exactly the way we did before (using String.IndexOf(), String.SubString() and String.Replace() methods).

So we add the following additional code to our ConfigureDataSourceProperties method;

   1:  if (dataSource.Query.IndexOf(USER_PROFILE_PROP_STARTSTRING) != -1 &&
   2:      UserProfileManager.IsAvailable(SPServiceContext.Current))
   3:  {
   4:      string strQuery = dataSource.Query;
   5:   
   6:      while (strQuery.IndexOf(USER_PROFILE_PROP_STARTSTRING) != -1)
   7:      {
   8:          strQuery = ReplaceUserProfilePropertyTokens(strQuery);
   9:      }
  10:   
  11:      if (strQuery != dataSource.Query)
  12:      {
  13:          dataSource.Query = strQuery;
  14:      }
  15:  }

This uses the additional method call ReplaceUserProfilePropertyTokens which is shown below:

   1:  private static string ReplaceUserProfilePropertyTokens(string strQuery)
   2:  {
   3:      // retrieve the current user's Profile
   4:      UserProfileManager upm = new UserProfileManager(SPServiceContext.Current);
   5:      UserProfile profile = upm.GetUserProfile(false);
   6:   
   7:      if (profile == null)
   8:      {
   9:          throw new ApplicationException("The current user does not have a User Profile");
  10:      }
  11:   
  12:      // extract the user profile property name from the token
  13:      int startIndex = strQuery.IndexOf(USER_PROFILE_PROP_STARTSTRING);
  14:      string strPropertyName = strQuery.Substring(startIndex + USER_PROFILE_PROP_STARTSTRING.Length);
  15:      strPropertyName = strPropertyName.Substring(0, strPropertyName.IndexOf(TOKEN_ENDSTRING));
  16:   
  17:      string strToReplace = strQuery.Substring(startIndex);
  18:      strToReplace = strToReplace.Substring(0, strToReplace.IndexOf(TOKEN_ENDSTRING) + 1);
  19:   
  20:      try
  21:      {
  22:          // get the value
  23:          UserProfileValueCollection propertyValue = profile[strPropertyName];
  24:          string strValues = String.Empty;
  25:   
  26:          foreach (object propValue in propertyValue)
  27:          {
  28:              if (propValue.ToString().IndexOf(" ") == -1)
  29:              {
  30:                  strValues += propValue.ToString() + " OR ";
  31:              }
  32:              else
  33:              {
  34:                  strValues += "\"" + propValue.ToString() + "\" OR ";
  35:              }
  36:          }
  37:   
  38:          if (strValues.Length > 0)
  39:          {
  40:              strValues = strValues.Substring(0, strValues.Length - 4);
  41:          }
  42:   
  43:          // swap the value out in the query
  44:          strQuery = strQuery.Replace(strToReplace, strValues);
  45:   
  46:      }
  47:      catch (ArgumentException ex)
  48:      {
  49:          throw new FormatException("The User Profile Property specified in your UPP token does not exist", ex);
  50:      }
  51:      return strQuery;
  52:  }

So there are a few things to point out here which might trip you up:

  • We are using the UserProfileManager.IsAvailable() method to find out if we have a user profile service application provisioned and assigned to the current Web Application.
  • At the moment this code throws an error if the current user doesn’t have a User Profile. You may want to handle this differently for your environment?
  • Handling of multi-value fields. At the moment all we do is take the string values and concatenate them with “OR” in the middle. So if you had “Value1; Value2” as your property value the Token replacement would put “Value1 OR Value2” as the search query.

As long as the content editors are aware of the behaviour this allows us to create quite complex queries.

Example if we now used the Fixed Query:

([UPP-SP-Responsibility]) AND Write:[TODAY-14]..[TODAY]

Then for a user who’s “Ask Me About” properties were “SharePoint” and “IT Administration” then the resulting Search Query would be:

(SharePoint OR “IT Administration”) AND Write:13/05/2012..17/05/2012

If another user comes along whose “Ask Me About” property was just set to “Marketing” then the resulting Search Query would be:

(Marketing) AND Write:13/05/2012..17/05/2012

This is without changing any of the web part properties, and allows us to drive dynamic content from a single web part to our entire user base.

Hopefully you can see that this is incredibly powerful and flexible.

Step 5 – Making it re-usable Part 3 – Controllable Sort By
The final step is to allow our content editors to control the “Sort By” functionality. The default OOTB webpart only allows us to sort by “Relevance” or “Last Modified”, which is fine when you are looking at general search results, but when you are building custom components (such as news, links or event feeds) you typically want to control the order by date or title or something a little more usable for the specific component.

So this bolt-in allows you to control the Sort By. First off we need to add some Web Part Properties so that the user can modify their values:

   1:  [Personalizable(PersonalizationScope.Shared)]
   2:  [WebBrowsable(true)]
   3:  [WebDescription("Sort by this managed property")]
   4:  [WebDisplayName("Managed Property")]
   5:  [Category("Sort Override")]
   6:  public string OrderByProperty { get; set; }
   7:   
   8:  [Personalizable(PersonalizationScope.Shared)]
   9:  [WebBrowsable(true)]
  10:  [WebDescription("Sort direction")]
  11:  [Category("Sort Override")]
  12:  public Microsoft.Office.Server.Search.Query.SortDirection SortDirection { get; set; }

This will provide the Web Part property editing functionality:
image

Once we have done that, we can add the following code to our ConfigureDataSourceProperties method (yes .. this method really is where all of the grunt work goes on in this web part!)

   1:  // if OrderByProperty is not set, use default behavior
   2:  if (!string.IsNullOrEmpty(OrderByProperty))
   3:  {
   4:      // change the sortorder
   5:      dataSource.SortOrder.Clear();
   6:      dataSource.SortOrder.Add(OrderByProperty, SortDirection);
   7:  }

And that is all there is to it.

Step 6 – Enjoy!
So congratulations if you made it this far. I know this was a long blog post but thought it was worth walking through it properly.

If you have any questions, feedback or questions then please get in touch using the comments, and here are links to the downloads (which are also referenced at the top of this blog post)

Some notes about the “final” version:

  • The code structure is slightly different because the DateTime [TODAY] queries are cached using Web Part Properties for better performance
  • the [TODAY] token is case sensitive!
  • There is an extra “Debug Mode” checkbox in the Web Part Properties which when enabled spits out the entire query being executed at the bottom of the search results.
  • Code contains an “Editor Part” .. this just clears out the Cache value when the web part properties are modified

Usage Summary:

Tokens you can use are:

  • [TODAY]
  • [TODAY+X] (add X days)
  • [TODAY-X] (remove X days)
  • [UPP-{Internal Name of User Profile Property}]

Example Usage

Sample user has:
Name: Martin Hatch
Ask Me About: SharePoint; Solution Architecture; Code

ContentType:Event AND ([UPP-SPS-Responsibility]) AND Write:[TODAY-7]..[TODAY]
becomes
ContentType:Event AND (SharePoint OR “Solution Architecture” OR Code) AND Write:12/05/2012..17/05/2012
Returns all events which were updated within the past week, and contain the current user’s “Ask Me About” values.

Author:[UPP-PreferredName] IsDocument:1
becomes
Author:”Martin Hatch” IsDocument:1
Returns all documents written by the current user

Author:[UPP-PreferredName] Write>=[TODAY-14]
becomes
Author:”Martin Hatch” Write>=02/05/2012
Returns all content created by the current user and updated within the past 2 weeks

How to place custom HTML in the Office 365 public website footer

This is the second time I’ve come to do this, so thought I’d ping out a quick blog post showing how it works.

The requirement is simple, how to get a “proper” Copyright symbol in the footer of a public website? (although you can also use this technique for other methods too .. such as adding analytics tracking codes and JavaScript to your site!)

The Problem – OOTB dialog does now allow HTML editing
When you are using the standard Office 365 public website editor, you are stuck with the standard dialogs for header / footer / theme and such.

The “footer” dialog is woefully lacking, and doesn’t even allow basic HTML editing

This unfortunately leaves you with an extremely basic footer text, missing items which you would normally include (such as the Copyright symbol ©).

SharePoint Designer to the rescue ..

Yes .. I admit I didn’t really expect to hear myself saying this either, but it does seem like SharePoint designer is the answer here.

The actually footer text values are stored in the SPWeb.Properties bag, in a specific property called wh_footertext.

(in fact .. if you look through the properties there are all sorts of values to play about with, including the logo URL, Footer links, site usage information, and a few HTML placeholders for things like Left Nav and the Site Map .. well worth a look!).

So, when you open up SharePoint Designer you can actually get to the Properties values by using the Site Options link in the Ribbon;

This opens up a simple dialog picker where you can modify any of the available properties;

And when you edit the wh_footertext then you get complete control over the entire footer (including, interestingly enough, the wrapping SPAN tags as well!)

Having made this simple change we simply refresh our webpage and all is done 🙂

Another simple but quick one. Hope you find it useful!

Looking back on “going native” – why I decided to think inside the Microsoft box

I’ve been thinking about this quite a lot recently, with the rather spurious Google privacy policies, and new versions of Chrome / FireFox / Opera popping up every few weeks.. I am looking back on over 12 months of “going native”. By this I mean I have been using nothing but Microsoft technologies for all my core working functions;

  • Internet Explorer (no add-ins)
  • Bing Search
  • No Visual Studio extensions
  • Windows Phone 7

And so far .. I am absolutely loving it!

It all started with Bing and Windows Phone 7 …

This really started back in early 2011 when Bing was actually starting to come good. Their mapping service was getting some good reviews, I knew from various Microsoft events that their Search engine had undergone a pretty thorough overhaul from its early days, and I had also recently gotten myself a new (at the time) Windows Phone 7.

The default search engine for this was Bing, and I admit .. I was a very hardened Google search kinda person. I had it as my home page, I used iGoogle, and I had been doing so since its early days in 1999 (when I started at University). So I was more than a little irked to find that in Windows Phone 7 I couldn’t actually change the default search provider (like I had done with each new install of FireFox .. my default browser at the time).

This made me think;

Why do I use Google Search? Is it because it is better, or is it just because it is “what I’ve always done”?

So .. instead of installing one of the half-dozen (slightly dodgy looking) free Google apps on the marketplace, I decided to just start using Bing on a daily basis to see if I could change my habits.

Disclaimer .. I will admit I also have ulterior motives for this. I have spent the past 8 years working for Microsoft Partner firms and (as you can tell from my blog) my day-to-day working life is very heavily Microsoft influenced … so following the “all in” mantra I wanted to see if I could practice what I preach and basically use nothing but Microsoft for a while to see if there was anything lacking.

So anyway .. I started using Bing search .. and you know what? It is actually pretty damned good! I am a pretty heavy user of search (I must use browser based searching at least 10 times every day .. and on heavy days I can be looking for stuff several times an hour). This can be anything from searching for blog posts and technical articles, to using it for a quick-reference for MSDN and finding class library references when coding.

In a six month period I only felt the need to return to Google search twice, and both times I couldn’t find what I was looking for on Google either!

So I ended up pretty much converted overnight. I even started correcting people when they were suggesting a search; they said “Google it” and I said “no, Bing it instead!” (muscle memory is by far the hardest part of change!).

… what came before, is, and shall be again … moving to Internet Explorer …

So next up was the internet browser.. like I said, I was a big FireFox fan and I used to regularly install a whole raft of plug-ins and addons (including custom themes .. the whole works .. yeh, a proper geek-job!). Before that I was (in my youthful ignorance at school) a user of IE (back in the days of IE5, IE5.5 and IE6) .. so it was interesting that this has ended up going full-circle!

For those who don’t know me very well my job also involves a fair bit of client-site work, and quite a lot of the time they will give me a corporate workstation with their own corporate build (which by default was almost always IE8 and IE9). I was also in the habit of re-installing / optimising my own personal laptop as well and was getting pretty fed up of having to install a new browser and a bunch of add-ons every time I setup a new machine (which including all of the client workstations and virtual machines I was given .. this was almost every 2 weeks at one point!).

So .. I thought .. why not give Internet Explorer another go? IE9 had come out shortly after I made the switch to Bing search and it was getting some good reviews … more minimalistic design, cross-application tabs, a vastly faster javascript engine and much much better HTML and CSS support than previous versions.

So I actually un-installed FireFox (to force myself to use IE). This actually worked out quite well because the locked-down corporate workstations were all using IE as well (like I said .. I work in the Microsoft space so they were all usually standard Windows build machines).

A few weeks of painful “argh .. where has that button gone?” moments went past .. and then, I started to realise with a bit of shock, I actually quite liked it!

My RSS driven drop-down favourites worked just as well as they did in FireFox, the pop-up blocker, InPrivate Browsing, page compatibility mode and built in DOM inspector were doing the job for me functionally, and the search (which defaults to Bing .. which was another win from my earlier switch :))

Here I am 12 months later, rocking on with IE9 and looking forward to getting IE10 on my machine. The browser still seems really quick (although I’m sure having a fast laptop with tonnes of RAM helps!) and honestly I’ve found that pretty much every single website I visit works perfectly well, first time and every time!

… if you can build it, then you don’t need them to come .. Visual Studio …

Well .. by this time I was well on my way. I was now using exlusively Internet Explorer for my day-to-day work, my search engine was Bing, I was using Bing Maps (on both desktop and my phone) and life was pretty good. Every single new laptop or server I logged onto was already setup exactly how I wanted it to be (i.e. pretty much the default settings).

So I started looking at what else I was using. Visual Studio was a big one, which typically gets bolted on with all sorts of “productivity enhancement” tools (such as Re-Sharper typically being one of my default addins for a couple of years). So I wanted to try coding without this installed!

Now … I have to admit, I’ve never been totally sold on the value of Re-Sharper, but perhaps that harks back to the days of building SharePoint 2003 solutions pretty much in NotePad, creating DDF files and using batch scripts with MakeCAB commands to generate the WSP files. One of my internal concerns about everything being automated for you is that you tend to forget how things work, and why you are doing them in a certain way (but hey .. faster, more consistent development is good for the industry in other ways too).

Again … I found I was suprised by what you can actually achieve out of the box (especially with Visual Studio 2010). I perhaps found I was relying on add-on tools to do things that had been added to the core product over time, but I never realised (such as Ctrl-M, R to refactor code into a method). Sure .. there are a few small things I miss (like removing redundant “USING” statements in C#) but generally speaking 99% of my coding life I can achieve just as fast but using OOTB tools.

Again, when I move between client-site development teams this has been extremely useful. My Muscle memory has now been trained to Visual Studio 2010 in its “native” mode .. so I don’t have any of those “oops, I pressed the wrong key” moments in my first few weeks of development, which has been really nice 🙂

.. finding the time to think inside the box ..

So .. all in all a great experience, and I have to admit I feel really good that I can honestly champion Microsoft technology to my clients having been “dog-fooding” the self-same technology myself.

I now also use SkyDrive (with LiveMesh) and Office 365 for all my for my cloud needs (one for personal, one for business) although I’ll be writing another blog post about that another time.

I have found myself more and more looking at the other tools I use and finding out what “off the shelf” solutions I can use instead … I have started using Microsoft OneNote more and more (and my favourite function is Win+S to open up a “screen clipping” tool so you can copy select parts of the screen into the clipboard .. it may seem basic but I used to have another 3rd party tool to do that kind of thing).

Do I still have other kit installed? Sure I do .. I still have Chrome, Opera, Safari and FireFox (hey .. I do web development, it would be criminal if I ignored them completely!) and I do occasionally go back to Google search, or Yahoo / Ask just to find out if they are doing things differently.

But for now .. life is good … life is OOTB!

SharePoint Rockstar – a Nickelback Parody

This was inspired by a short twitter conversation with @cimares, @ToddKlindt and @usher about the #SharePoint #Rockstar and the potential for a rip off parody of the Nickelback song “Rockstar“..

Basically I felt like finishing the song off .. so without further ado .. to the tune of Nickelback’s “Rockstar” I give you ..

SharePoint Rockstar..

I’m through with coding in line
And unghosting everything
I’m using SharePoint Designer
And I’m never gonna win
The solution didn’t turn out
Quite the way I want it to be
(Tell me what you want)

I want a brand new blog,
with the comments all filled
And a server room I can play baseball in
And a laptop full of software that
I got for free
(So what you need?)

I’ll need a Skype account that’s got no limit
A huge laptop with an SSD in it
Gonna get my own
parking space at TVP
(Been there, done that)

I want to get an invite to a conference pass
My own seat up in Business Class,
Somewhere between Spence and
Steve Smith is fine for me
(So how you gonna do it?)

I’m gonna tweet like made, adopt SharePoint zen
I’ll use the hashtag  #SP2010

[Chorus:]
‘Cause we all just wanna be big rockstars
Fixing errors in the logs that are just bizarre
I code so much I got RSI, but my User Profile Service gonna start first time!
And we’ll hang out in the SharePint bar
In the VIP with the SharePoint stars
Every ITPro and coders
gonna wind up there
With our free vendor shirts
That we just won’t wear
Hey I wanna be a SharePoint rockstar
Hey I wanna be a SharePoint rockstar

Wanna be great like Eric Schupps but without the hat
Pass every single exam I’ve sat
Talk at the User Group
So I can get my drinks for free
(I’ll have a SharePint on the house!)

I’m gonna get the latest version
Setup on my VM
Get a free Ultimate key to MSDN
Gonna date a designer
who builds all my sites for free
(so how you gonna do it?)

I’m gonna tweet like mad, adopt SharePoint zen
I’ll use the hashtag  #SP2010

[Chorus:]
‘Cause we all just wanna be big rockstars
Fixing errors in the logs that are just bizarre
I code so much I got RSI, but my User Profile Service gonna start first time!
And we’ll hang out in the SharePint bar
In the VIP with the SharePoint stars
Every ITPro and coders
gonna wind up there
With our free vendor shirts
That we just won’t wear

And we’ll hang out in the speaker rooms
With all the MVPs and whoever is cool
I’ll build you anything with cascading styles
Everybody’s got a contractor on speed dial

Hey I wanna be a SharePoint rockstar

I’ll annoy QA by writing messy code
I’ll deploy my solutions in debug mode

I’ll get an off-shore team to write all night long
Then I’ll code it again because they’ll get it all wrong ..

[Chorus:]
‘Cause we all just wanna be big rockstars
Fixing errors in the logs that are just bizarre
I code so much I got RSI, but my User Profile Service gonna start first time!
And we’ll hang out in the SharePint bar
In the VIP with the SharePoint stars
Every ITPro and coders
gonna wind up there
With our free vendor shirts
That we just won’t wear

And we’ll hang out in the speaker rooms
With all the MVPs and whoever is cool
I’ll build you anything with cascading styles
Everybody’s got a contractor on speed dial

Hey I wanna be a SharePoint rockstar
Hey I wanna be a SharePoint rockstar

Hey check out my new brick .. it looks just like a Nokia Lumia 800!

Today has not been a good day as I am now holding a completely useless “bricked” Lumia 800 .. but first let us wind back 3 weeks when my wife and I became proud owners of brand spanking new Nokia Lumia 800 phones running Windows Phone 7.5 (“Mango”).

The new Nokia Lumia 800, running Windows Phone 7.5

Yep .. thats right .. we both got the same phone (she got the blue / cyan one .. I got the black one). You might think this a little sad (his and hers?) but honestly I find providing “tech support” far easier when we both have the same handset 😉

Anyway .. so we left the store, brand new phones in hand. They were very shiny, they looked slick, they started up quickly and seemed like honestly damned good phones.

We both got our email setup quickly (both Hotmail and Exchange accounts) and while my better half was merrily catching up on Facebook, I was very impressed with the SharePoint integration and how it automatically configured the Office Hub when it realised my email account was on Office 365! Very slick…

What Battery Problems?
Now I had heard that there were battery problems, but a recent software fix seemed to sort this out. One of the very first things I did (with both phones) was plug them into Zune, get them synced up and install the latest software fix (so my phone is currently fully patched and running the latest version!).

My wife’s phone was having an issue with battery life before the update (it dying after 12-15 hours) but this was well documented, and after we updated the phone everything seemed to be fine ..

in short .. life in the Hatch household’s mobile world was good ..

so now lets wind on to last week ..

What do you mean you can’t turn it on ??
The first sign of problems was actually on my wife’s phone (the blue/cyan one for those of you paying attention!). She was coming to meet me in London after work and the usual agreement of “I’ll send you a text message when I’m outside your office” .. now the work day came, went and started slipping when I finally got a phone call from a pay-phone … my wife was frantic as her phone had turned itself off despite still having over 20% battery life remaining! and it would not turn on!

Eventually I managed to meet up (strangely difficult without constant-on communication .. how on earth did I manage before I had a mobile phone?) and I looked at the handset itself… I tried 6 times in a row to turn the phone on and kept trying periodically for another 10-15 minutes … I tried it again one final time and it worked, buzzing into life like a defibrillator had just kicked it into life. I quickly logged in, went to the Settings and checked the “Battery Saver” and it said it had 23% battery with approximately 15 hours remaining …. how bizarre …We didn’t see the problem happen since (and we both use our phones quite a lot every single day) so I put it behind me and we kind of forgot about it ..

now lets wind on to today (or more accurately last night)

Congratulations! Its a Brick!
I was heading over to a friend’s house .. now this particular friend has been having problems with his Android phone and was quite keen on looking at the latest flagship Windows Phone .. so I took mine out of my pocket and tried to unlock it … nothing .. dead as a doornail.

I tried to turn it on .. nothing … held down the power button for up to 30 seconds … tried again .. still nothing. So then I thought .. “maybe the battery is dead??”. So I borrowed his micro-USB charger and left it to charge for 20 minutes. I then came back .. still won’t power on.

So now I am panicking .. I took my precious new phone home and left it on charge for 9 hours overnight but this morning? Nothing .. no life .. completely dead.

Now I have since attempted various tricks on the internet from various forums:

  • Some people said it can’t recharge if the battery hits 0% so heat the phone up and THEN try plugging it in .. this didn’t work!
  • Tried holding down the power button for 8 seconds (apparently this resets the power-cycle) .. that didn’t work
  • Tried unplugging and re-plugging the charging cable several times in a row while either holding down or randomly trying the power button … didn’t work
  • Tried a “hardware reset” by holding down the Volume Down, Camera and Power buttons … that didn’t work either!

So what now? My new shiny Lumia 800 is officially bricked!

I will be taking this back to the Orange store that I got it from ASAP .. I expect them to replace it .. but I have already seen evidence of this strange issue on my wife’s phone last week .. so will this keep happening?

I really hope this is a software bug (so they can release an update) .. or perhaps a really rare glitch in hardware that just HAPPENS to have struck both me and my other half at the same time.

If any of you have experienced the same problem please let me know in the comments… Otherwise I’ll see what happens when I get mine replaced / repaired and let you all know!

21 Things I would do if I was an evil SharePoint overlord!

  1. All site collections will be deployed with site collection quotas allowing only 1 sandbox resource point
  2. The Site collection storage limit warning will be set at 1mb for My Sites with the entire company set as the warning email address
  3. I will insist that all site collections are created with their own host name URL. This will force any BI tools to require new SPNs for Kerberos configuration
  4. Ideally, each of these sites will have their own Web Application, and their own application pool, which will force them to buy new servers so keeping within the “10 application pools per server” guidelines which I will give them
  5. Every web application will have a custom service connection proxy group, so every time a new service application is created they will have to manually add it to each web application’s custom proxy group
  6. All databases will be created through Powershell by concatenating random GUIDS (in addition to the ones SharePoint creates automatically)
  7. While developing, all of my API classes will be public with internal constructors
  8. All default site content will be deployed using HTML encoded XML, with multiple unecessary nested divs and empty spans.
  9. Feature Stapling will be banned .. as will Content Types
  10. I will configure all Diagnostics Log categories to “Verbose”, disable flood protection and only keep log files for 1 day, making it a painful and arduous task to troubleshoot issues.
  11. Each SharePoint server will install to a non-default directory. This will be different for each server to keep the admin team on their toes.
  12. I will include a script which adds expiration policies to the “Document” content type in each site collection .. this will bombard the author with emails if they don’t update their documents every 2 weeks, therefore keeping the content fresh
  13. SharePoint Designer will be unblocked, and its usage will be encouraged!
  14. The User Profile database will be configured to crawl every 2 minutes .. keeping the process continually running so no-one can modify the connections
  15. For contrast, the default Search content source will only index User Profile content every 56 hours .. so no-one can be exactly sure when it will be updated
  16. Each web application will be given different URLs for each department. IIS bindings will be put in place, but no alternate access mappings so they cannot share links or embedded urls with each other.
  17. The default zone will be set as Read Only via a policy so that items found in search results cannot be edited. there will be an alternate URL, but access mappings won’t exist so users will have to swap it out manually
  18. The reply-to email address for all notificatiosn will be set as the company switchboard.
  19. All custom web parts will, where possible, be deployed as Farm Features .. so that everyone can see them, but will only be configured to work on specific sites.
  20. We will not have specific servers .. all farm servers will run all of the services. I will convince the IT team that this makes their lives easier as they only need 1 server spec when buying new machines.
  21. I will set the qouta of the my site host to 10MB so that only the first few users will be able to upload their profile picture.

Suggestions are welcome in the comments 🙂

I’m speaking at the International SharePoint Conference

Yep, its that time again and one of the biggest, most innovative and best SharePoint conferences is back for another year.

This conference has been through a few iterations in its time going by the names “SharePoint Best Practice Conference” and “SharePoint Evolution Conference” but they have now dropped those for a more simplified “International SharePoint Conference“.

The conference is held in London, Westminster  (April 23rd – 25th) and this year promises to be an absolute cracker! The best thing about this year’s conference is that they are doing “Solution” tracks, following a single thread from concept all the way through. This will involve all angles from IT Pro, Developer, Information Worker .. and really helps to tie together all those pieces that make up a single complex problem. For the first time you won’t have a session saying “well .. this next bit is really important but we don’t have time ..” at this conference they will make the time, whether they need 3, 4 or even 6 sessions to get through the whole problem.

One of the best quotes comes from the organiser, Steve Smith (@SteveSmithCK):

As you can see it is very exciting and different unlike any other agenda attempted by a SharePoint conference.

For example: A total of 10 solutions over the three Information Worker tracks based on different real world scenario’s with one solution alone covering 7 sessions to completion and speakers working together over the sessions to build the solution.

A lot of people have asked me how I have been able to build such an agenda. The answer is pretty straight forward. unlike most SharePoint conferences that are run by conference events companies Combined Knowledge actually understands SharePoint and we know the people out there who are specialists in those subject areas to come and talk on it, we have been working with SharePoint for 10 years and over those years I have had the privilege to meet some very smart people in the SharePoint world and therefore I personally build the agenda and along with some specialist from each track we are working with the speakers to make it happen.

I also look at the current maturity model of the product and what type of content people are searching for and then finding the best way to deliver that content in a format that people will enjoy watching and listening to as well as learn from it. In my opinion that is the only way you can truly deliver a conference that provides the attendees with the knowledge needed to take away and use in the real world.

The Agenda and Speaker List looks amazing .. if you haven’t bought a ticket yet then you are most definately missing out!

I’m speaking too …

And this year I have my own slot talking about Real World: Building a global Business Intelligence Extranet, from End Users to Support and Operations.
(CS701).

This is basically a combination of technical and logistical problem solving involved at my main project over the past 12 months delivering a global Business Intelligence extranet in SharePoint 2010.

The main thing here is that we are not just talking about the technical problems (like multiple languages and scalability) but more about the operations and admin side of things, like how do you track and manage security for thousands of databases and thousands of users at the same time?

There is also the problem of processing and updating tens of thousands of OLAP cubes every month, and add to this other third party BI tools (which sit alongside Excel Services, PerformancePoint Services and Reporting Services) and you have a big challenge on your hands.

Well, I certainly hope to see you there. Even if you don’t make to my session (there are loads of great session tracks on all three days) then grab me during one of the breaks, or one of the SharePints afterwards and I’ll be happy to chat.

DNS Records required to use Lync Online (Office 365) with a Vanity Domain

Note – this only applies if you have your own “vanity domain” such as companyname.com. This does not apply if you are using the Microsoft Online domains “onmicrosoft.com”

I’ve seen quite a few people asking for help with this, and struggled a little bit when I first set this up myself, so I thought I would post the DNS entries that are required to get Lync Online working.

These are generic DNS records, so it doesn’t matter what server / service you have.

Now, first off you will need to get yourself a relatively advanced DNS Management Service. I personally use the most excellent Zone Edit (www.zoneedit.com). This is completely free and allows you a very high level of control over what records you can create. I have found with some of the other DNS management sites that sometimes you cannot create some of the required records (such as SRV records).
DNS Records described by Office 365 Portal

There is 1 SRV record and 2 CNAME records that you need to create.

You can find these in your Office 365 Portal under “Domains” and “verify DNS Settings”. Below is the screenshot from my own Portal Site for my domain “hatchsolutions.co.uk”.

The thing to note is that it gives you the full host-name entry for each of the records you need to create. When you actually create these (depending on your DNS management tool) you will probably only need the prefix for the host name.

So the three records you need to create are:

  • _sipfederationtls
    • Type: SRV
    • Port: 5061
    • Weight: 1
    • Priority: 100
    • TTL: 3600 (seconds)
    • Target: sipfed.online.lync.com
  • sip
    • Type: CNAME
    • TTL: 3600 (seconds)
    • Host-Name: sipdir.online.lync.com
  • lyncdiscover
    • Type: CNAME
    • TTL: 3600 (seconds)
    • Host-Name: webdir.online.lync.com

So you can see above, I have only used the initial part of the full hostname. Having a CNAME record called “sip” in my managed domain “hatchsolutions.co.uk” gives me the fully-qualified address “sip.hatchsolutions.co.uk”.

But … that’s not all …

I also found in my environment that one more SRV record was required, which for some reason was missing from the official instructions. I honestly can’t remember where I found this (credit goes to someone wonderful person on the blogosphere somewhere) but the details are below:

  • _sip._tls
    • Type: SRV
    • Port: 443
    • Weight: 1
    • Priority: 100
    • TTL: 3600 (seconds)
    • Target: sipdir.online.lync.com

I found that once that is also in place, everything started working. You may need to wait for 24 hours (for this to propogate round the world’s DNS servers) and you should be good to go! (I think I had to wait a good few hours before mine started working .. so please be patient!)

Recent Entries »