Thursday, 24 February 2011

SharePoint Online Beta primer for developers

Overview: The development API is based on SharePoint 2010 server side object model so it's robust, flexible subset of SharePoint 2010 on-premises editions.
  • You obviously can configuration SharePoint Online using your browser, or SharePoint Designer 2010·
  • You can use VS 2010 to write custom code and this is what i am interested in.
  • My understanding is that SharePoint developers should have an easy path to SharePoint Online development.
  • For a test environment you will have the same API that is available as a sandboxed solution on the on premises version depending on licencing selected.
  • Your local SharePoint 2010 development environment is where you will write code that will be uploaded to SharePoint online via a solution package.
  • You will be able to intelletrace (VS universal and debugging) on the uploaded code in production.
  • Development teams will find it alot easier to develop locally and then deploy the finalised code.
  • Custom code can either be deployed in a sandbox solutions or a custom application can be written that will make use of the Client Object Models (Silverlight, .Net framework or ECMA Script)
  • Sandbox custom code is deployed through SharePoint solutions (wsp packages)
  • You won't have access to deploy Full trust proxies so this means functionality that you usually write as FullTrustProxies will not be available. A common example is logging to the ULS. Similarly you won't be able to log to your own custom logging system unless you offer an accessible interface that can be called from the sandboxed code.
This post is based on the SharePoint Online Developer Overview beta documentation.

Update: 25/02/2011 - Steve Fox wrote this recently for SharePointPro Connections, "What Will it Be Like to Develop for SharePoint Online?"

Virtualising SharePoint 2010

Overview:  I was reading Michael Noel's article on "Going Virtual with SharePoint 2010", it is a good read and is very useful in pointing out how to virtualise.  My key point here would be don't virtualise SQL Server you just won't get the IOPS to make it worthwhile.

Nearly 2 years ago I was speaking to the lead architect for a big FTSE 100 enterprise who heavily use SharePoint 2007 at the time.  His key message was don't virtualise the WFE's, I disagreed with him which apparently wasn't a good idea but outside of his single point his claims were not worth accepting.  His key point was you will get a 10-15% (a guess) performance increase using physical over VMWare on the same hardware.  Michael Noel states "Generally, the virtualization overhead required to run virtual servers is only 5 percent".  I can't see any discernable degradation but there will be some performance hit by using a hypervisor.  His farm was rather large but I feel he just didn't trust virtualisation.  Today it's pretty main stream to put you WFE's and application servers on a VM platform.  Especially if it's done correctly as outlined in Michael's article the minor pass thru resource lost is easily made up for with flexibility that VM's offer you namely:
  • Hardware become cheaper you can easily up size you VM's on new hardware with more resources as time move on, you don't need to add more servers to the farm.  I have had several clients start with a part of there business using SharePoint, it's much easier to setup a resilient infrastructure that can be moved over servers using VMotion and upgrade the hardware. 
  • Additional servers are easy to add to the farm as you simply add a new VM onto your hardware.  This is pretty minor but you don't need to do purchasing and the hard yards associate with hardware additions.  If the company has the resources (CPU, memory and disk) it simple to request more VMs or additional resources to existing VM's.  With the cost of hardware halving every 18 months it's a no brainer if your organisation can move to virtualised servers.
  • Disaster recovery is only improved, you may have a bit backup for DR but being able to pull down machines and move them is always useful.
I use HyperV at home as I have only 2 servers and my technet licences give it to me for free.  I merely spin up machines and install the roles I require.  I even VM my AD & SQL box for development. 
On production environments it is HyperV or VMWare for me. It comes down to you engineers experience and preference.  If it is a greenfield project and licencing costs are not a concern I lead my clients to VMWare as I know it better and know it performs and is maintainable.  Saying that I have setup farms using HyperV, this is generally for smaller institutions and it works brilliantly.
Tip: Separate physical network cards for each VM & don't put SQL on a VM.
Tip: Follow Michael Noel's article when virtualising your SharePoint farm and get a virtualisation expert to help you do the setup.


How is SharePoint selling - a consultancy services roadmap

Overview: SharePoint is being taken up very quickly but it's a difficult market to measure.  A figure I heard at a conference a few months ago is that for every $1 spent on licencing generates $6 in consultancy.  I don't know this ratio was determined but if the number of licences being sold is on the up, it follows there will be a great deal of consulting services needed.

Most organisations I have dealt with use SharePoint to a very limited extent.  It has a lot more to offer than clients are taking up.  Intranets, file server replacement and collaboration are the main impetus for using SharePoint.  My feeling especially with SharePoint 2010 will be a shift toward better integration and using SP as a development platform.  Office 365 plays into this consultancy business also.  The main issue will be with setup/on site installations taking a hit however there still will be a need on site installations but more companies will choose SharePoint as a service and this is only a positive that results in more people taking to the product.

The companies affected will be the hosting companies as they will loose a lot of there sales, Azure will also affect them.  They have been loyal customers of MS for years and unless they change their offering to be more consultancy service based they will take a huge hit.

Anyway some quotes to show how SharePoint is selling:

"SharePoint licenses have surpassed the 100-million mark and more than 17,000 customers use SharePoint." Microsoft Technet 9 Feb 2011.

"Microsoft’s fastest selling server based product" is a phrase often banded about not sure what this metric is but it sounds good.


Monday, 21 February 2011

Mapping internal users (LDAP) to the cloud

Overview: Steve Plank has a great video on "How ADFS and the Microsoft Federation Gateway work together up in the Office 365 Cloud". 

To get your internal ADFS users to authenticate in the Microsoft cloud (Azure and Office 365), you do need ADFS 2.0.  The claims based authentication that can be setup in SharePoint 2010 is how Office 365 and AZURE will authenticate AD users. 

You users will access SP2010/MS Online365/AZURE Web application using their browser.  The end application sends the browser a response redirecting them to the MS Federation Gateway (MFG)/App Fabric/STS web service (SP2010 on site editions), this in turn passes the users browser onto ADFS.

ADFS generates the user a SAML token and the are redirected to the MFG, MFG in turn generates it's own SAML token containing it's claims and the browser is redirect back to the originally requested web application.

For a user trying to access SharePoint Online from their internal network, you can see the user makes several requests to different points along the chain however the key result being the user get securely authenticated against you internal Active Directory (AD).
Steve Planks video is easier to follow than this post but it's worth understanding the process as it applies to Azure, SharePoint claims based authentication and Office 365.  This coupled with custom LDAP providers results in a consistent manner to handle authentication in the cloud using you internal LDAP directory.

Below is an animation describing the process whereby a user is authenticated on their internal network and then they use SharePoint Online (Office 365).
More Info:

Settingup ADFS for SharePoint Reference:

Wednesday, 16 February 2011

UK Cloud User Group

Yesterday I attended the 2nd Cloud Evening meeting it was terrific - this event focused on Microsoft's offering.  Specifically the latest version of Azure (1.4 I think) and it looks impressive.  Previously, I felt limited by Azure however, I think Azure SQL is a good option for storing application data especially when Office 365 is released or to extend SharePoint 2010. 

Both Mark Rendle and Planky (Steve Plank) gave good presentations.  I came away with tons of information and I'm pleased I went along.  Planky's blog is definitely worth following.  The security around Azure and Office 365 is fairly complex but considering the integration with LDAP providers and the security considerations it is well thought out and tooled.

Additional Info:

Monday, 7 February 2011

SP2010 Coding Tips

Retrieving a list using the Serve-side Object Model
Problem:  In MOSS we could use CAML queries or the SharePoint API (Server side object model) to retrieve list data.  In SP2010 there are various methods for getting a list however, the Server-side Object Model has been improved/enhanceced.

SPSite site = new SPSite("");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Customers"];

If the list doesn't exist you received a NullReferenceException.  A try catch block is usually wrapped around the list retrieval however, SP2010 has an improved method TryGetList().

SPList list = web.TryGetLists["Customers"];  // if list doesn't exist list will be null.
Other improvements to the API include: TryGetFieldByStaticName,

Disposing Objects
Problem: SPSite and SPWeb objects are not automatically disposed.
Resolution:  Use either using statements or try catch finally statements to dispose of SPWeb and SPSite objects.  Check all code using the SPDisposal tool.

More Info:
Reading this post jogged my thoughts on the 2 topics posted above.  This is useful for SP developers to know.

Saturday, 5 February 2011

What version of SharePoint do I have? Common mistake!

Problem: You have a SharePoint web site and you have no idea what version is running.

Initial Hypthesis: Using Central Admin (CA) you can lookup the exact version.  However, if you are looking ata  website or don't have CA access, a lot of people think they can look at the http header.  (You can see the https header using fiddler or the IE developer tools).  However, the http header with the version number is not the actual version installed.  It is the version when the SharePoint install was performed!
This behaviour applied to MOSS and I have no idea if it is fixed in SP2010.  The http and you version number will be idenitcal if you install using slipstreamed images as the install will include the patches you have in you install.
  • You can't rely on the http header SharePoint version number returned via the page requests to determine the version of SharePoint you are looking at.
  • I recommend removing the http header info for SharePoint as it makes a hackers life marginally more difficult as they don't know what version you are patched to or originally installed.  They will also need to use another technique to determine if your website is a SharePoint server. 
  • Todd Bleaker has a simple technique for identify SharePoint public websites, "Since most people allow anonymous access to the images in the 60 Hive/12 Hive and there really isn't any reason to remove the default images (in fact it probably isn't supported), it is an easy litmus test to detect SharePoint.  However, I recently wanted to determine whether a site was SharePoint 2010 or not, but since visual upgrade is now a viable upgrade scenario and CPVW.GIF is not unique to the SharePoint 2010 I needed something new to look for. So, I poked around a bit and found that /_layouts/images/FGIMG.PNG isn't too hard to remember and it shows an equally unlikely image to be in a non-SharePoint 2010 site". 
More Info:

Update 28/03/2010 - Todd Carter has a post on versions of SharePoint Versions
Update 20/02/2012 - PS to determine SP edtition and patching level

Friday, 4 February 2011

MOSS export list SSL issue

Problem: I can't export a list to a excel spreadsheet file from a SharePoint 2007/WSS3.0 site is using SSL.  SP2010 exports https lists correctly. 
Initial Hypothesis: File is being exported however, when opening the *.iqy file, the error "Excel cannot connect to the SharePoint list." pops up. 
Resolution: This is a bug with 2 workarounds,
  • Option1: From excel connect to the list. or
  • Option 2: Save the *.iqy file, open it using notepad, chnage the url to use https instead of http (it occurs twice in the iqy file.

Issue in Document libraries in MOSS using Word 2010

Problem:  The business upgrades there Office desktop version to Office 2010.  If a user needs to add new documents into a document library running on MOSS.  Word 2010 opens and then throws the error "This file could not be found.".
Initial Hypothesis: Office(Word) 2007 and Office(Word) 2003 can create the new documents.  Office(Word) 2010 can edit a document added by a previous version or an uploaded document correctly.  The issue appears to be between Word 2010 and document libraries in MOSS when adding a new document under SSL.

I can open the full url to the word template correctly using IE and Word 2010, so the issue must be with the url that is crafted for Word 2010.

I was looking at the templates associate with each content type in my document library, the path is always relative however, as I am adding the the template it stores a relative value.

Resolution: The url that is requested using the new document derives from the content type's default document template.  My site uses SSL, and it looks like the path that SharePoint generate is incorrect (I need to confirm this using fiddler, but as I'm on my clients site using a locked down workstation and no access to the servers I can't see the url being generated).  Anyway, my fix is to save the full https path in the "Enter the URL of an existing document template".