Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SQL Server 2014 with Powershell v5 Cookbook

You're reading from   SQL Server 2014 with Powershell v5 Cookbook Over 150 real-world recipes to simplify database management, automate repetitive tasks, and enhance your productivity

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher Packt
ISBN-13 9781785283321
Length 760 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Donabel Santos Donabel Santos
Author Profile Icon Donabel Santos
Donabel Santos
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Getting Started with SQL Server and PowerShell 2. SQL Server and PowerShell Basic Tasks FREE CHAPTER 3. Basic Administration 4. Security 5. Backup and Restore 6. Advanced Administration 7. Audit and Policies 8. High Availability with AlwaysOn 9. SQL Server Development 10. Business Intelligence 11. Helpful PowerShell Snippets A. PowerShell Primer B. Creating a SQL Server VM Index

What this book covers

Chapter 1, Getting Started with SQL Server and PowerShell, provides an introduction on how to work with SQL Server and PowerShell, including an introduction to SQL Server Management Objects (SMO). This chapter provides a recipe to install SQL Server using PowerShell and helps you explore and discover SQL Server-related objects and cmdlets.

Chapter 2, SQL Server and PowerShell Basic Tasks, provides scripts and snippets of code that accomplish some basic SQL Server tasks using PowerShell. Tasks include listing SQL Server instances, discovering SQL Server services, configuring SQL Server, importing/exporting records in SQL Server, and creating objects such as tables, indexes, stored procedures, and functions. Some recipes also teach you how to work with Azure SQL Database.

Chapter 3, Basic Administration, explores how administrative tasks can be accomplished in PowerShell. Some recipes deal with how to create SQL Server instances and database inventories, how to check disk space, running processes, and SQL Server jobs. Other recipes show you how to attach/detach/copy databases, add files to databases, and execute a query to multiple SQL Server instances

Chapter 4, Security, focuses on how to work with SQL Server service accounts, manage logins/users/permissions, and monitor login attempts and also how to work with database roles, credentials, and proxies.

Chapter 5, Backup and Restore, teaches you what you already know about SQL Server backup and restore procedures and shows you how these tasks can be done using PowerShell. Many recipes use SQL Server-specific cmdlets, such as Backup-SqlDatabase and Restore-SqlDatabase wherever possible, but also utilize SQL Server Management Objects (SMO) to get more information on backup metadata. Some recipes also help you tackle backup and restore to Azure BLOB storage.

Chapter 6, Advanced Administration, discusses some of the most advanced features of SQL Server and how you can work with them in PowerShell. Recipes in this chapter include how to work with LocalDB, database snapshots, Filestream, FileTable, Full-Text Index, memory-optimized tables, security objects such as certificates, symmetric and asymmetric keys, and setting up Transparent Data Encryption (TDE).

Chapter 7, Audit and Policies, focuses on how to work with SQL Server tracking and auditing capabilities and SQL Server Policy Based Management (PBM). This chapter also explores how to work with SQL Server Profiler trace files and events programmatically.

Chapter 8, High Availability with AlwaysOn, covers specific recipes that can help you manage and automate SQL Server AlwaysOn, including how to install the failover cluster feature, enabling AlwaysOn, creating AlwaysOn availability groups and listeners, and testing the availability group failover.

Chapter 9, SQL Server Development, provides snippets and guidance on how you can work with XML, XSL, JSON, binary data, files in FileTable, and CLR assemblies with SQL Server and PowerShell.

Chapter 10, Business Intelligence, covers how PowerShell can help you automate and manage any BI-related tasks, including how to manage and execute SQL Server Integration Services (SSIS) packages, list and download SQL Server Reporting Services (SSRS) reports, and backup and restore SQL Server Analysis Services (SSAS) cubes.

Chapter 11, Helpful PowerShell Snippets, covers a variety of recipes that are not SQL Server-specific, but you may find them useful when working with SQL Server and PowerShell. Recipes include snippets for creating files that use timestamps, using Invoke-Expression, compressing files, reading event logs, embedding C# code, extracting data from a web service, and exporting a list of processes to CSV or XML.

Appendix A, PowerShell Primer, offers a brief primer on PowerShell fundamentals for the SQL Server professional. This chapter includes sections on how to run PowerShell scripts, understand PowerShell syntax, and convert scripts into functions to make them more reusable.

Appendix B, Creating a SQL Server VM, provides a step-by-step tutorial on how to create and configure the virtual machine that was used for this book.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image