Saturday, October 18, 2014

How to disable SharePoint designer for a Web Application/Site in production farm – SharePoint 2010

Opening SharePoint designer in production farm is generally not recommended because of huge performance hit. A power user having access to edit pages, open pages in designer may start SharePoint designer in production farm that may result in lot of performance hit. This post describes the steps how you can disable SharePoint designer for a particular web application in your production farm.

Step1: Browse SharePoint Central Administration and go to Application Management

Step2: Click on Manage Web Applications link




Step3: Select a particular web application for which SharePoint designer need to be disabled and then click on General setting drop down menu



Site collection administrator can also disable the SharePoint designer setting from the Site Settings page as shown below



Step4: Click on SharePoint Designer from the General settings menu, uncheck the checkbox “Enable SharePoint Designer” as shown below



SharePoint designer can be enabled/disable by checking the “Enable SharePoint Designer” check box.

Once SharePoint designer is disabled for the web application, a user would see following message when trying to edit the page in SharePoint designer



How to Change Service Applications for a Web Application – SharePoint 2010

A Web application can be connected to the default set of service applications or to a custom set of service applications. You can change the set of service applications that a Web application is connected to at any time. There are two ways you can change the service applications 1) by using either the “Service Connections” option or 2) by going to “Configure Service Application Association” page in Central Administration.
Steps for both ways are as follows:-
    
    1)  Using “Service Connections” options

Step1: Browse SharePoint Central Administration and go to Application Management

Step2: Click on Manage Web Applications link






Step3: Select a particular web application for which service connection need to be changed and then click on Service Connections icon in top command actions menu














Step4: Select Custom option from the drop down, and choose the required service applications that need to be associated to the selected Web Application





































2)  Using “Configure Service Application Association” page in Central Administration

Step1: Browse SharePoint Central Administration and go to Application Management


Step2: Click on “Configure service application association” link under Service Applications section



Step3: Click on a particular web application link for which service connection need to be changed


Step4: Select Custom option from the drop down, and choose the required service applications that need to be associated to the selected Web Application



Monday, February 17, 2014

PowerShell 3.0 issue with SharePoint 2010

All of sudden my PowerShell stopped working with following error:-

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



I am currently with SharePoint 2010 on my development machine on Windows 7with SP1. After SharePoint installation for couple days PowerShell was working absolutely fine but now when I need to do something with scripting it has stopped working.

Tried two things very quick but still no luck:-
  1. I have already tried to run PowerShell run as Administrator
  2. I have already given SharePoint_Shell_Access permission to the farm account on SharePoint Config. and Admin Content both databases.

As a next step I investigated the current version of PowerShell, I started PowerShell window and just run the command:-

$psversiontable

I found following:-



As you can see it is PowerShell Version 3.0 which doesn’t support SharePoint 2010 http://blogs.msdn.com/b/ronalg/archive/2013/07/29/10382902.aspx?CommentPosted=true#commentmessage

Now how come it is upgraded to PowerShell 3.0, I found that on my system there was windows update installed as shown below, which has installed Windows Management Framework 3.0. WMF 3.0 also includes PowerShell 3.0, you can see on this link http://www.microsoft.com/en-us/download/details.aspx?id=34595




Solution:
To resolve the issue quick: I changed PowerShell start menu short cut path and added –version 2.0 switch parameter, below is the complete path with –version 2.0 switch.

C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\PowerShell.exe -version 2.0 -NoExit  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1' "
Add –version 2.0 swtich

By doing this I could run PowerShell 2.0 which support SharePoint 2010 commands

Reference links:-




Wednesday, January 22, 2014

SharePoint Site Custom Web Part SQL Report Viewer Export to Excel Error

Problem:

"The file you are trying to open '<FileName.xls>', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file.

I faced this issue in QA environment for one of the SharePoint project where in there was a sql report rdlc file which was rendered in a report viewer control. When I try to Export to Excel the report it throws above error and when I click on Yes option to open the file it opens blank.
I could export the report to PDF and work that works absolutely fine but only the problem was with Export to Excel.

When I login with ADMIN account everything works fine, with admin account I could export the report to excel without any error.

Solution:

There could be multiple reasons for the problem explained here, so not sure this solution will work for you but it worked great in my case.
  1.  Check the app pool account of the site where you are generating the report (say the app pool user account is: farmAppPoolUser
  2. Now browse the location:
  3. C:\Users\ farmAppPoolUser \AppData\Local\Temp 
  4. Add "Authenticated Users" to Temp directory with "Full Control" permissions.


References: