How to install and activate SharePoint feature using Powershell and STSADM

In this SharePoint tutorial, we will discuss how to install and activate SharePoint feature using Powershell and STSADM in SharePoint 2010/2013/2016.

We will see here how we can install and activate feature using PowerShell and STSADM.

Install and activate SharePoint feature using Powershell

Below is the PowerShell command to install and active the feature in SharePoint 2010/2013/2016.

PowerShell command to Install Feature

Install-SPFeature FeatureFolderName

Here FeatureFolderName folder must be presented inside C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES directory.

You have to check the directory based on the SharePoint version.

PowerShell Command to Activate/Enable Feature

Enable-SPFeature FeatureFolderName -Url http://ur-site-url

PowerShell Command to Disable Feature

Disable-SPFeature FeatureFolderName -Url http://ur-site-url

Here FeatureFolderName folder must be presented inside C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES directory.

PowerShell Command to Uninstall Feature

Uninstall-SPFeature FeatureFolderName

Here FeatureFolderName folder must be presented inside C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES directory.

STSADM command to install activate feature SharePoint

Now we will discuss stsadm command to install activate feature SharePoint 2010/2013/2016.

Here are some commands to install, activate, deactivate, and uninstall features in SharePoint 2010 through stsadm.

STSADM command to Install Feature

STSADM.EXE -o installfeature
 {-filename  |
 -name }
 [-force]

STSADM command to Activate Feature

STSADM.EXE -o activatefeature
 {-filename  |
 -name  |
 -id }
 [-url ]
 [-force]

STSADM command to Deactivate Feature

STSADM.EXE -o deactivatefeature
 {-filename  |
 -name  |
 -id }
 [-url ]
 [-force]

STSADM command to Uninstall Feature

STSADM.EXE -o uninstallfeature
 {-filename  |
 -name  |
 -id }
 [-force]

Deploy SharePoint 2010 solution (.wsp) package using Powershell

In this article, we will discuss how to deploy the SharePoint 2010 solution package (.wsp) using PowerShell.

Follow the below steps:

Step-1: Start PowerShell command prompt, Go to Start -> All Programs -> Microsoft SharePoint 2010 Products -> open SharePoint 2010 Management shell

Type the command

Step-2: Add Solution Package

Add-SPSolution "C:\SharePoint2010Solution.wsp"

Step-3: Install Solution Package

Install-SPSolution –Identity SharePoint2010Solution.wsp –WebApplication http://myserver –GACDeployment

If you are using Sandbox Solution,

Step-4: Install Solution Package

Install-SPUserSolution –Identity SharePoint2010Solution.wsp –WebApplication http://myserver –GACDeployment

For Updating the Sharepoint 2010 Solution type the following commands

Step-5: Update Solution Package

Update-SPSolution –Identity SharePoint2010Solution.wsp –LiteralPath "C:\SharePoint2010Solution.wsp" –GacDeployment

For retract and remove a solution, type the following commands:

Step-6: Uninstall Solution Package

Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myserver

Step-7: Remove Solution Package

Remove-SPSolution–Identity MySharePointSolution.wsp

You may like following PowerShell SharePoint tutorials:

I hope this PowerShell SharePoint tutorial helps to install and activate features using PowerShell and STSADM in SharePoint 2010/2013/2016.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>