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

Summary


Many SQL Server administration tasks can be accomplished using PowerShell. In this chapter, we covered tasks ranging from listing databases and files, attaching and detaching databases, monitoring and managing logins and users, to checking jobs and invoking policies.

The SQLPS module comes with some cmdlets that can be used, for example Backup-SqlDatabase and Restore-SqlDatabase, as well as a number of cmdlets related to AlwaysOn. However, the number of cmdlets in SQLPS is still quite few. Often, accomplishing tasks more effectively via scripting will require you to use SMO, especially for tasks where appropriate cmdlets are not available.

In the next chapter, we will explore different ways to send queries to SQL Server via PowerShell.