Home > Sample chapters > Programming > Visual Studio and .NET

Using Windows PowerShell to Perform and Automate Farm Administrative Tasks in Microsoft SharePoint 2010


This chapter explains how you can become familiar with the new Windows PowerShell cmdlets introduced by SharePoint 2010. It explores the SharePoint 2010 Management Shell and how to accomplish some simple but powerful administrative tasks using one-line Windows PowerShell commands.

There are more than 500 SharePoint cmdlets. This chapter could not possibly explain each command; instead, its aim was to provide some general guidelines and good practices for using SharePoint PowerShell in a production environment, such as the configuration and use of remote management, the voluntary use of transcripts, and the use of the –whatif parameter. You should not practice or try out Windows PowerShell commands for the first time on your production environment. Keep your scripts simple, use comments to document your scripts, and don’t use or create aliases if the scripts are going to be supported by administrators who are unfamiliar with Windows PowerShell.

The chapter covered two important cmdlets, Start-SPAssignment and Stop-SPAssignment, in some detail. These cmdlets help with cmdlets that return disposable objects, such as SPSite, SPWeb, and SPSiteAdministration. Other SharePoint cmdlets were introduced to expand your knowledge of Windows PowerShell techniques. Chapter 12 builds on this chapter, using search scenarios. The next chapter continues the discussion of SharePoint 2010 farm management and specifically the Central Administration interface.