다음을 통해 공유


Administering Service Applications Using the SharePoint 2010 Management Shell

Applies to: SharePoint Foundation 2010

The SharePoint Management Shell in SharePoint Foundation 2010 provides an extensive set of Windows PowerShell cmdlets that make development, deployment, and administration of SharePoint 2010 easier and more efficient.

The SharePoint Management Shell supersedes the Stsadm.exe administration tool. All current and future development of command-line tools and administrative files in Microsoft SharePoint Foundation 2010 should use this new scripting technology.

Note

The Stsadm commands used to create, enumerate, and manage Shared Services Providers (SSPs) are not usable with the Service Application Framework.

Adding the SharePoint Snap-In to Windows PowerShell

To use the SharePoint Foundation 2010 cmdlets from inside the Windows PowerShell command window, you can add the SharePoint 2010 snap-in to Windows PowerShell.

To add the SharePoint snap-in to Windows PowerShell

  1. Open Windows PowerShell.

  2. In the Windows PowerShell window, type get-PSSnapin – Registered. The SharePoint Foundation 2010 snap-in is listed.

  3. In the Windows PowerShell window, type Add-PSSnapin Microsoft.SharePoint.Powershell.

You can also add the Windows PowerShell snap-in permanently to your Windows PowerShell $profile.

Managing Service Applications Using Windows PowerShell Commands

The following table describes the Windows PowerShell nouns and verbs that developers of Service Application Framework applications will most commonly use to manage services, service instances, and service applications.

Table 1. Windows PowerShell Nouns and Verbs for use with the Service Application Framework

Noun

Windows PowerShell Commands

SPService

  • Install-SPService

SPServiceInstance

  • Get-SPServiceInstance

  • Start-SPServiceInstance

  • Stop-SPServiceInstance

SPServiceApplication

  • Get-SPServiceApplication

  • Publish-SPServiceApplication

  • Remove-SPServiceApplication

  • Set-SPServiceApplication

  • Unpublish-SPServiceApplication

SPServiceApplicationProxy

  • Get-SPServiceApplicationProxy

  • Remove-SPServiceApplicationProxy

SPIisWebServiceApplicationPool

  • Get-SPServiceApplicationPool

  • New-SPServiceApplicationPool

  • Remove-SPServiceApplicationPool

  • Set-SPServiceApplicationPool

Documentation of these cmdlets is provided in the SharePoint Management Shell.

Best Practices for Creating Cmdlets

When you develop your service you can override the SharePoint 2010-specific Windows PowerShell verbs to add their own parameters. However, such custom parameters must conform to the same standards as SharePoint 2010. The following are suggested best practices to use when you create or modify cmdlets:

  • If you are deriving from an existing object, replace the SP prefix on the noun with the name of your service or feature.

  • If you are deriving from an existing SharePoint 2010 object, call the base object's methods for all common operations.

  • Reuse existing parameter names whenever possible.

See Also

Concepts

Introduction to Cmdlets for the SharePoint Management Shell

Windows PowerShell in the SharePoint Management Shell