Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

06 May, 2012

Sharepoint 2010 - Delete A service application using Powershell

Some times You will find that you are not able to Delete the Service Application using the GUI . That`s the time when I have used the Powershell Command which works almost 100 % and quick .

Before you delete a service application, verify that its removal will not adversely affect users. As a best practice, you should ensure that no Web applications are currently consuming the service application that you are going to delete

When you delete a service application, you have the option to also delete the service application database (not all service applications have databases).

To delete a service application by using Windows PowerShell

  • On the Start menu, click All Programs.
  • Click Microsoft SharePoint 2010 Products.
  • Click SharePoint 2010 Management Shell.
  • At the Windows PowerShell command prompt, type the following commands.
To retrieve the service application that you want to delete, type the following command

$spapp = Get-SPServiceApplication -Name "<Service application display name>"

Where <Service application display name> is the display name of the service application that you want to delete.

The service application information will be stored in the $spapp variable Or You can also UseGet-SPServiceApplication cmdlet to list all service applications

To delete the selected service application, run one of the following commands. In both cases, you are prompted to confirm the deletion.

To delete the selected service application without removing the service application database, type the following command:

Remove-SPServiceApplication $spapp

To delete the selected service application and also delete the service application database, type the following command:

Remove-SPServiceApplication $spapp -RemoveData

If you Know the ID of the service application Then you can Also Use

Remove-SPServiceApplication -Identity <ID> -Remove Data

19 April, 2010

SharePoint Management Shell

One of the most important feature present in sharepoint 2010 is called as "sharepoint Management shell/sharepoint Powershell " Which contains the Powershell cmdlets for SharePoint, by using this we control and manage the SharePoint operations like we done in STSADM command.

It will take some time to understand but start rolling with all new 652 power shell cmdlets in SharePoint 2010 as compared to STSADM based 182 commands in SharePoint 2007.


To Install feature,
PS> Install -SPFeature

To activate the feature for the site,
PS> Enable -SPFeature -Url http://server/site_name

I hope the above information will helps you to gain some insight of Sharepoint management shell. Please let me know in case of any queries,Thanks !!