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 2012 with PowerShell V3 Cookbook

You're reading from   SQL Server 2012 with PowerShell V3 Cookbook

Arrow left icon
Product type Paperback
Published in Oct 2012
Publisher Packt
ISBN-13 9781849686464
Length 634 pages
Edition 1st Edition
Concepts
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 (21) Chapters Close

SQL Server 2012 with PowerShell V3 Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with SQL Server and PowerShell FREE CHAPTER 2. SQL Server and PowerShell Basic Tasks 3. Basic Administration 4. Security 5. Advanced Administration 6. Backup and Restore 7. SQL Server Development 8. Business Intelligence 9. Helpful PowerShell Snippets SQL Server and PowerShell CheatSheet PowerShell Primer Resources Creating a SQL Server VM Index

Working with the sample code


Samples in this book have been created and tested against SQL Server 2012 on Windows Server 2008 R2.

Note

To work with the sample code in this book using a similar VM setup that the book uses, see Appendix D, Creating a SQL Server VM.

How to do it...

If you want to use your current machine without creating a separate VM, as illustrated in Appendix D, Creating a SQL Server VM, follow these steps to prepare your machine:

  1. Install SQL Server 2012 on your current operating system—either Windows 7 or Windows Server 2008 R2. See the list of upported operating systems for SQL Server 2012:

    http://msdn.microsoft.com/en-us/library/ms143506.aspx

  2. Install PowerShell V3.

    • Although PowerShell V3 comes installed with Windows 8 and Windows Server 2012, at the time of writing this book these two operating systems are not listed in the list of operating systems that SQL Server 2012 supports.

    • To install PowerShell V3 on Windows 7 SP1, Windows Server 2008 SP2, or Windows Server 2008 R2 SP1:

      Install Microsoft .NET Framework 4.0, if it's not already there.

      Download and install Windows Management Framework 3.0, which contains PowerShell V3. At the time of writing this book, the Release Candidate (RC) is available from:

      http://www.microsoft.com/en-us/download/details.aspx?id=29939

  3. Enable PowerShell V3 ISE. We will be using the improved Integrated Scripting Environment in many samples in this book:

    • Right-click on Windows PowerShell on your taskbar and choose Run as Administrator.

    • Execute the following:

      PS C:\Users\Administrator>Import-Module ServerManager
PS C:\Users\Administrator>Add-WindowsFeature PowerShell-ISE
      
    • Test to ensure you can see and launch the ISE:

      PS C:\Users\Administrator> powershell_ise
      

      Alternatively you can go to Start | All Programs | Accessories | Windows PowerShell | Windows PowerShell ISE.

    • Set execution policy to RemoteSigned by executing the following, on the code editor:

      Set-ExecutionPolicy RemoteSigned

      Note

      If you want to run PowerShell V2 and V3 side by side, you can check out Jeffery Hicks' article, PowerShell 2 and 3, Side by Side:

      http://mcpmag.com/articles/2011/12/20/powershell-2-and-3-side-by-side.aspx

See also

You have been reading a chapter from
SQL Server 2012 with PowerShell V3 Cookbook
Published in: Oct 2012
Publisher: Packt
ISBN-13: 9781849686464
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