Book Image

PowerShell for SQL Server Essentials

By : Donabel Santos
Book Image

PowerShell for SQL Server Essentials

By: Donabel Santos

Overview of this book

Table of Contents (15 chapters)
PowerShell for SQL Server Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Implementing Reusability with Functions and Modules
Index

SQL Server Management Objects


The SQLPS module exposes over 50 SQL Server-related cmdlets as of SQL Server 2014. This may seem more than a handful, but these cmdlets only cover a fraction of what you may want to do with SQL Server. There will be times when you may want to programmatically manage SQL Server, and SMO may be the most flexible way to do this.

SMO allows you to have programmatic access to SQL Server objects using languages such as VB.NET, C#, and PowerShell.

Note

To learn more about SMO classes and how to program specific tasks, visit the SMO documentation page from TechNet at http://msdn.microsoft.com/en-us/library/ms162169.aspx.

To install SMO, you need to run the SQL Server setup binary and select Client Tools SDK in the Features Selection window:

Once installed, the SMO namespaces that become available with SQL Server 2014 are as follows:

  • Microsoft.SqlServer.Management.Smo

  • Microsoft.SqlServer.Management.Common

  • Microsoft.SqlServer.Management.Smo.Agent

  • Microsoft.SqlServer.Management...