Posts Tagged ‘sharepoint’

After installing/downloading PowerShell 3.0 (part of the Windows Management Framework 3.0), opening up the SharePoint 2010 Management Shell suddenly says the following:

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

PowerShell 3 Error

PowerShell 3.0 uses the .NET 4.0 Framework, whereas the SharePoint 2010 CmdLets (and .NET API) requires the .NET 2.0/3.5. because of COM components under the covers.

The fix is to run PowerShell under .NET 2.0 mode by calling powershell.exe with the -version 2 switch.

Update the default shortcut, by editing the properties and change the target:

PowerShell 3 - Step 1

PowerShell 3 - Step 2

From:

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "

to:

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit -version 2  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "

Then you will be back in business next time you launch the shell.

During the planning stages of a MOSS 2007 to SharePoint 2010 content migration, I encountered some Fab 40 Site Templates in the existing environment. To try and reduce the amount of customisations in the new environment going forward,  I needed a way to bring the content of the site over, without needed the underlying Site Template. The Site Template needed to be changed before or during the upgrade to remove the dependancy. Initially I thought it might be possible to use SPWeb.ApplyWebTemplate to change the site definition in the 2007 environment before it was upgraded, but this works only for empty sites without a template applied (the Site Collection is created, but no template chosen). The same question of changing the Site Template once a site has been provisioned has been asked over at SharePoint Overflow.

When upgrading a Site Template between 2007 and 2010, you can use an Upgrade Definiton which defines how to remap files, lists and features, but is doesn’t look possible to change one template to another. This would also require creating a replacement site definition for the Fab 40 template and having to support it in the new environment.

The simplest way I can see is to use the AvePoint SharePoint Migrator, which allows you to specify the source and destination site definition as part of the upgrade.

This weekend I attended SharePoint Saturday Adelaide and picked up some handy tips and tricks from the following sessions:

Understanding SharePoint 2010 databases and storage – Alexandre Bacchin

Key databases to isolate and monitor:

  • Usage and logging (write heavy)
  • Search property store (ready heavy)
  • Web analytics and reporting (can become large with heavy usage)
  • Content databases – best to separate collaboration/intranet/My Site/management board. (I normally have a 1:1 mapping for collaboration and intranet site collections to content databases).

Other topics covered were:

  • RBS (Remote Blob Storage) and disaster recovery
  • Content databases should be maximum of 200GB (SQL database + RBS), not 200GB + RBS. The bottleneck is the number of list items in the database, not the blob size. With many list items, the list item table locks increase response time for users.
  • High availability and disaster recovery though SQL clustering and mirroring.

Dos:

  • Optimise tempdb by using the fastest storage available.
  • Set MAXDOP=1. SharePoint queries aren’t processing large datasets in a single query (like a data warehouse), so using parallelism over multiple CPU’s creates more overhead than executing on a single CPU.
  • Run regular maintenance plans.
  • Monitor growth of content and search databases.
  • Set a restore plan and strategy (NOT JUST A BACKUP PLAN).
  • Use SIMPLE recovery for dev and test environments. It uses less space (no log file) which increases in size quickly when constantly restoring sites.

Don’ts:

  • Change any of the SharePoint database schemas (SharePoint checks, plus it will void your warranty :) ).
  • Change database file groups (leave it up to the DBAs).
  • Let other applications access SharePoint databases directly. (Bad for security and may have issues with locks). Use one of the proper APIs instead.
  • Never shrink content databases.
  • Use RBS to get around the 200GB limit.

Performance development considerationsElaine van Bergen

A great introduction to improving performance and diagnosing issues with server side page rendering times with the emphasis on publishing sites and custom code.

Covered:

New for me:

  • Object cache multiplier.
  • An SPRequest object is 1:1 with a SQL connection.
  • SharePoint returns a health score for the current WFE to let the client know how much load the farm is on. It also disables certain features under heavy load (eg InfoPath Forms Services). It returns the HTTP header X-SharePointHealthScore in the range of 0 to 10, with 0 being least amount of load. SharePoint Workspace uses this score to determine how aggressively to synchronise content to the client.

The complete slide deck is available.

Developing Advanced User Experience in SharePoint 2010Brian Farnhill

Brian used a video sharing site example to show how to use out of the box components and functionality, to write code, but less of it.

I was paying too much attention to take many notes, but the overview is available.

Takeaways:

  • Remember the user experience!!!!
  • Try and make custom solutions look and feel like out of the box SharePoint.
  • Instead of hand crafting an HTML table, use the InputFormSection control which SharePoint uses for its pages.
  • Use the load on demand javascript framework built in to load external javascript files for when they are needed in the page lifecycle.
  • Yes, the Tags & Notes button is broken, you need to mouseover it to make it appear pink (indicating there are existing notes or tags).
  • I am going to use the buttons on the ribbon in a solution I am currently working on.

 

I ended up winning a free copy of TypeMock Isolator from the day as well, which I am looking forward to making good use of.