Communicating with SQL Server via SMO
The two main reasons for communicating with SQL Server are to manage the server and to use the data contained on the server in some way. Not only are administrators expected to manage the server efficiently, but they're also frequently asked to extract some corporate data to send to another application, to make quick updates to correct a problem, or to respond to other such requests. SQL Server management can be done from PowerShell or any other .NET language using the Server Management Objects library, and the data can be accessed using ADO.NET.
SQL Server Management Objects
SQL Server Management Objects (SMO) and its related sisters (RMO for Replication Management Objects and AMO for Analysis Services Management Objects) are object libraries that provide a programmatic way to manage Microsoft SQL Server. SMO can be used to manage SQL Server 2005, 2008, 2008 R2, and 2012. It was introduced with SQL Server 2005 but supports the management of SQL Server 2000 instances as well. SMO was built using the .NET Framework, so the objects it exposes are available in PowerShell.
You work with the SMO every time that you navigate Object Explorer in SSMS, so you're already somewhat familiar with its use, some of its capabilities, and its hierarchy. In addition to Object Explorer, the Object Explorer Details view (press F7) inside of SSMS is great for getting more familiar with SQL Server objects and their properties.
Before using SMO within PowerShell, ...