Friday, November 16, 2012

SharePoint 2010, server 2012 and Powershell 3: Microsoft SharePoint is not supported with version 4.0.30319.17626 of the Microsoft .Net Runtime

If you are running SharePoint 2010 on a Server 2012 OS be aware of the current compatibilty issue that is identified with SharePoint Powershell and Powershell 3.

In order to make use of the powerfull powershell commands, all you need to do is switch the powershell version back to version 2.
Note: This will not uninstall version 3, it will simply launch a new powershell instance that uses version 2.

There I fixed it!

Information from Tom Van Gaever

Tuesday, August 21, 2012

PowerShell Commands To List SharePoint Features


The more I work with SharePoint 2010 the more I am starting to love PowerShell. My scripting skills are pretty basic (!) but here are a couple of useful little snippets to get back some information from a site that previously I would have spent a while going through the UI or SharePoint Root – mainly as a reminder for myself!

List all installed features on the farm
It’s really straight forward using the Get-SPFeature command to return all installed features. To provide a little more readability to the output it can be sorted as follows:

By feature display name alphabetically,

Get-SPFeature | Sort -Property DisplayName

By feature ID,

Get-SPFeature | Sort -Property Id

By feature display name alphabetically and grouped by scope,

Get-SPFeature | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id

And to write this to a file to allow for viewing in Notepad, Excel etc,

Get-SPFeature | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id > c:\AllInstalledFeatures.txt


List all activated site scoped features
Especially in the case of hidden features it’s sometimes necessary to track down if a feature is active on a site collection. Here’s a quick way of seeing which features are activated for an SPSite:

Get-SPFeature -Site http://sitecollectionurl | Sort DisplayName | FT DisplayName,Id

List all activated web scoped features
And only slightly modified from the Get-Help Get-SPFeature -examples text, here is a command to list all web activated featres for a site collection:

Get-SPSite http://sitecollectionurl | Get-SPWeb -Limit ALL | %{ Get-SPFeature -Web $_ } | Sort DisplayName -Unique | FT DisplayName,Id

Information given by Glyn Clough

Thursday, July 12, 2012

Error message: (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

This is the common error when we are working with sql server.It will occur while establishing a connection to sqlserver.In this post i will explain how to resolve network and remote connection error.First we need to check the given data source name is correct or not in connection string.The TCP/IP protocol or in some instance the Named Pipes protocol should be enable to made such type connection.The following steps will describe how to enable TCP/IP or Named Pipes protocol in sql server configuration manager
Go To-->Configuration Tools folder which is in MS Sql Server 2008 folder in start menu
2.Select server Network configuration-->click on protocols for SQLEXPRESS.
Then we can see the protocols at Right side panel.By default the TCP/IP status is in disable mode.So we need to change status to enable

 3.Select SQL Server Services --> right-click on your instance of SQLEXPRESS / SQLServer and click "restart"

Reference

Thursday, September 15, 2011

Where is “Save As Template” in SharePoint 2010?

When publishing feature is enabled in SharePoint 2010, the “Save As Template” option would magically disappear. A quick solution to this is by manually using the URL /_layouts/SaveTmpl.aspx

Info from here

Thursday, August 18, 2011

Hide First Tab in SharePoint 2010 Navigation

I created a blog post on this for SharePoint 2007 HERE: But SharePoint 2010 is a bit more complex. Since it uses UL’s and Li’s for it’s navigation it is a bit harder to hide just one element.
image
You will notice that the Home tab actually is the first node and then has a child UL which represents the rest of the navigation Items. So the approach is to hide the first <li> <a> (display: none) and then simply just use (display:block ) to show the hidden <ul> <li> <a> tags.
Here is the CSS you could use to hide just the first node (home) tab in a SharePoint 2010 application:
.s4-tn li.static > a{
display: none !important;
}
.s4-tn li.static > ul a{
display: block !important;
}

image
Enjoy!

Information given by Erik Swenson

Monday, May 16, 2011

Easy way to Redirect Users to an Error Page in SharePoint

We as developers catch exceptions and try to gracefully educate our users on what might have gone wrong and what they are supposed do in the case of an error. If and how we notify the user depends largely on the type of exception as well as the type of SharePoint component i.e. Web Part, Event Handler etc.
Web Parts generally should show error messages within the web part. While event handlers will need to show the errors in a log perhaps. There is also another way, an easy way to show these type of errors.OOTB the WSS API provides a sleek one liner to handle things that go wrong in custom SharePoint components and show the system error page with our custom message.
The one liner:

SPUtility.TransferToErrorPage()

You can even pass a link so the user has a choice to come back to the active\home page of the site and start again

Information given by Rai