Monday, 25 February 2013

SharePoint 2010 HTTP 403: The Website declined to Show this webpage



Encountered this error HTTP 403: The Website declined to Show this webpage on the SharePoint Site Collection while doing some maintenance work

This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permissions to view the webpage



The error itself says the browser was able to connect but doesn’t seem to have permissions. In 2007 version, before taking backup’s site collections were set to read only so it doesn’t interrupt backup process or there are commands to lock the site with no access , read only etc.

 You can find this by executing the getsitelock command

stsadm -o getsitelock -url http://portal.contoso.com/

Result was noaccess that says no one not even Site Collection Administrator or nor Farm account can access the same

stsadm -o setsitelock -url http://portal.contoso.com/ -lock none

Other attributes that are available are none | noadditions | readonly | noaccess

ULS logs are not helpful as it should be at times and it’s frustrating to see this, no Info in ULS logs that the site is locked with no access.

Wednesday, 6 February 2013

Moving Site Collection between Content Databases in SharePoint 2010



Moving Site Collection to another Content Database in SharePoint  2010


We had a requirement to have the existing site collection to be moved to a new dedicated content database for various reasons in a test environment.

Before performing this check the:
  • Site Collection Size
  • Disk Space free on the Database server
  • Whether Audit data needs to be moved
  • Solutions in use on this Site Collection 
  • Backup of the Existing Content - just in case something goes wrong but this task is fairly simple it depends on the importance of the site collection.

 Here are the steps performed to accomplish this on the test environment:

1)     Create a New Content Database

Syntax: New-SPContentDatabase -Name <ContentDbName> -WebApplication <WebApplicationName>

Example: New-SPContentDatabase -Name WSS_Content_ProjectCentre -WebApplication ‘ContosoWeb’


2)    Move the Site Collection to a new content database


Example: Move-SPSite http://portal.contoso.com/sites/projectcentre -DestinationDatabase WSS_Content_ProjectCentre

Note: This doesn’t move the audit data if you have this in use, you have to use the other PowersShell commands please refer to the technet article.

3)     Run IISRESET to see the changes in Central Admin

4)     To Validate this:

Get-SPSite -ContentDatabase WSS_Content_ProjectCentre

Tuesday, 5 February 2013

Restore deleted site collection in sharepoint 2010

One of our developers’ created a test site collection on Test Environment and next day the site collection was missing.

Thankfully we had Service Pack 1 rolled out on our various environments which came handy, apart from the regular nightly backup's.

With Service Pack 1, there is a nice feature to restore a deleted site or site collection; here is what we did to restore the site collection

Launch SharePoint Management Shell

Run the command

Get-SPDeletedSite -Identity  /sites/ProjectCentre

This displays the following details, this is good to have info but would have appreciated if it had the information about what User / Service Account deleted the site collection


 
Anyways, found the site collection got deleted at 23:10:54. Checked the Timer Job history for the duration from 23:00 to 23:30, no jobs found which could do this, will have a look at ULS to find what happened.

Run the following command to restore the site collection

Restore-SPDeletedSite -Identity /sites/ProjectCentre

Or

Get-SPDeletedSite -Identity /sites/ProjectCentre | Restore-SPDeletedSite






Sunday, 20 January 2013

SharePoint 2010 Cannot add the specified assembly to the GAC



Error: Cannot add the specified assembly to the GAC in SharePoint 2010

We had a solution deployed numerous times as it houses a line of business process in SharePoint 2010. On performing Upgrade Solution via stsadm or Update-Solution via Power Shell , encountered the error: cannot add the specified  assembly to the GAC.

We started by created a test solution package and deployed it on the environment which worked fine to identify whether the issue was with the Package or environment.

On updating the LOB Solution , it couldn’t add the assembly to the GAC for LOB WSP, on one of the WFE servers.

Performed an IISRESET and restarted the timer service on the failing WFE,  deployed the WSP package again, it did work but when we tried updating it again at the later stage, got the same error.

I had to rely on Process Explorer to figure out what process was using the DLL and from where. The beauty of this tool is, it displays the list of processes running on the server and what DLL’s its using.

You can do a Find for the DLL file from the top menu bar to identify the process which it’s using.

I figured out using the Process Explorer, the Timer Service Process was referring to DLL from c:\windows\assembly\temp

I cleared the Temp folders which had the DLL, performed an IISRESET and restarted the Timer Service

This resolved the issue for me. You will have to identify what process is conflicting and troubleshoot the same accordingly.

Saturday, 19 January 2013

SharePoint 2013 Invalid URI: The URI is empty


I had a task to create a proof of concept environment for SharePoint 2013 for a presentation to a top level exec. Installed and Configured a SharePoint 2013 farm on couple of VM's with dedicated WFE/APP and SQL Server boxes, as this will be used as a POF and the requirements were not clear how long the boxes will be used. MS has released the deployment guide for 2013 must read before thinking of creating a new farm.

Created a new web application on the new farm and a  root level Site Collection based on Team Site Template. Till this moment everything was looking good. On accessing the Site got the following error   :

SharePoint returned the following error: Invalid URI: The URI is empty. Contact your system administrator for help in resolving this problem.

My  first encounter with an issue on 2013 on a vanilla environment, thought it would be good to have this as a reference.

To resolve this, I had to create and configure my site i.e.


  • Created a new web app for my site
  • Created the my site host site collection as the root
  • Provisioned the User Profile Service App
  • Configured the My Site URL in Setup My Site in User Profile Service App
  • IISRESET


On accessing the Team Site didn't find the error. 

Each environment is different and unique, ULS Log viewer was the key to identify and troubleshoot this.



Tuesday, 8 January 2013

Failed to get the server time zone id. Exception: Microsoft.SharePoint.SPEndpointAddressNotFoundException: There are no addresses available for this application.



Error : Failed to get the server time zone id. Exception:  Microsoft.SharePoint.SPEndpointAddressNotFoundException: There are no addresses available for this application. 

When I check the View Web Analytics Reports from Central Admin on Production, it throws the above error though it works on Test environment.

To resolve this, I have performed the following steps by looking at the ULS Logs.

Navigate to Central Administration
 
System Settings and click on Manage Services on Server

Stopped the following two services though it was already started

·         Web Analytics Data Processing Service
·         Web Analytics Web Service

Started the above two services but when I check View Web Analytics Report, doesn’t seem to work.

On Further checks found the Manage Metadata Service App wasn’t able to retrieve the metadata

Stopped and Started the Managed Metadata Web Service

This resolved the issue for me now able to view the Web Analytics Reports from Central Admin

If it doesn’t work, check the ULS logs to identify and troubleshoot  the issue.