Thursday 28 February 2013

WSS Usage Application proxy stopped on SharePoint 2013



The WSS Usage Service Application has still got an issue even with Vanilla SharePoint 2013 environment build. This is more likely a bug with SharePoint 2013 I hope Microsoft fixes this at some point in time.

Here is a screenshot of the same on a proof of concept environment I was building:

 
The Usage and Health Data Collection Proxy stopped. Launch the SharePoint 2013 Management Shell.

Get-SPServiceApplicationProxy

Copy the ID for Usage Service App and paste it below

$UsageApp = Get-SPServiceApplicationProxy | Where {$_.ID -eq "fd3df5dd-7e54-4206-
a28e-76019f1bf6ba"}

$UsageApp.Provision()

 This works now.

Wednesday 27 February 2013

Create Managed Metadata Service Application via Powershell in SharePoint 2013



In this article, we will go through the steps to create Managed Metadata. The steps are fairly simple but this is one piece which requires thorough planning based on the Organization's taxonomy if defined great if not plan.

There are four steps which are:

1) Plan whether to use a dedicated application pool or a shared one based on various factors

To find out the application pool's exists in your environment, try this in SharePoint PowerShell Management Console

Get-SPServiceApplicationPool

To get the list of managed accounts,

Get-SPManagedAccount

To create a new application pool with dedicated managed service account:

New-SPServiceApplicationPool -Name ManagedMetaDataAppPool -Account contoso\managedmetadata_svc

If you intend to use an existing app pool, change the name below.

2)  Create the Managed Metadata Service Application:

New-SPMetadataServiceApplication -Name "MetadataServiceApp" -ApplicationPool "ManagedMetaDataAppPool" -DatabaseName "MetadataDB"

3) Create the Managed Metadata Service Application Proxy

New-SPMetadataServiceApplicationProxy -Name "MetadataServiceProxy" -ServiceApplication "POFPROD_MetadataServiceApp"

4)  Configure the Service Application Association:

Add Managed Metadata in Service Application Association with the required Web Application. There is a Power Shell to do this shall to accomplish this will update the article at some other time

I would use Power Shell given any day as I can keep the databases clean without any GUID's.

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