Tuesday, July 21, 2015

Open Document in Client Applications by Default - PowerShell


"Open Document in Client Applications by Default"  in SharePoint 2013 from PowerShell.





Open SharePoint Management Shell and run next command.

Enable-SPFeature 8a4b8de2-6fd8-41e9-923c-c7c3c00f8295 -url http://WebApp/SiteCollection
In my case I have a root site collection.

 






To enable other feature, go to link

Monday, July 13, 2015

Moving a Site collection from one content database to another content database

Under some circumstances, you might want to move one or more SharePoint site collections to a different content database. For example, a site collection can outgrow the content database on which it resides, and you would have to move the site collection to a larger content database.
You can move site collections between databases in a SharePoint Server farm by using Microsoft PowerShell.

$siteUrl = Read-Host “Enter Site Collection URL to be moved”
$newDBName = Read-Host “Enter destination Database Name”
$contentDBInfo = Get-SPContentDatabase -Site $siteUrl
$oldDBName = $contentDBInfo.Name
Move-SPSite -Identity $siteUrl -DestinationDatabase $newDBName
Write-Host ""
Write-Host "Site collection " $siteUrl "has been moved from " $oldDBName "to " $newDBName " successfully." -ForegroundColor Blue

Create new Database in SQL Managemnet Studio.
In Central Administration add Database to Web Application.
Central Administration, Content Databases, choose Web Aplication, Add a content database.




















Run PowerShell as Administrator and start the script.







Possible error:

“Cannot complete the copy or merge operation because the database schema versions are different.”


Sometimes you content databases do not get properly upgraded during the installation of a cumulative update or service pack. There is a quick an easy fix. Just use the Upgrade-SPContentDatabase cmdlet to update the content database.


Upgrade-SPContentDatabase -Identity <content database name>



 

Wednesday, July 8, 2015

SharePoint configuration wizard Failed


An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: Failed to upgrade SharePoint Product













Resolution:

1. Clear configuration cache with GUI or PowerShell

2. Find current pv value using:

    stsadm -o getproperty -pn command-line-upgrade-running

    if -pv value is yes, change to No. If no change to Yes

    stsadm -o setproperty -pn command-line-upgrade-running -pv No


3. Re-run configuration wizard with PowerShell or GUI.

    PowerShell command:

    PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures


4. If still not working, you need server reboot.
 
 


 


 

Tuesday, July 7, 2015

Enable SharePoint Breadcrumb in Suite bar with PowerShell

Where is the breadcrumb in SharePoint 2013?
You can easily get back breadcrumb with powershell.


Enable SharePoint Breadcrumb script

Disable SharePoint Breadcrumb script



Note: Enter name of Web Application in script.