Book Image

SQL Server 2012 with PowerShell V3 Cookbook

By : Donabel Santos
Book Image

SQL Server 2012 with PowerShell V3 Cookbook

By: Donabel Santos

Overview of this book

PowerShell is Microsoft's new command-line shell and scripting language that promises to simplify automation and integration across different Microsoft applications and components. Database professionals can leverage PowerShell by utilizing its numerous built-in cmdlets, or using any of the readily available .NET classes, to automate database tasks, simplify integration, or just discover new ways to accomplish the job at hand."SQL Server 2012 with PowerShell V3 Cookbook" provides easy-to-follow, practical examples for the busy database professional. Whether you're auditing your servers, or exporting data, or deploying reports, there is a recipe that you can use right away!You start off with basic topics to get you going with SQL Server and PowerShell scripts and progress into more advanced topics to help you manage and administer your SQL Server databases.The first few chapters demonstrate how to work with SQL Server settings and objects, including exploring objects, creating databases, configuring server settings, and performing inventories. The book then deep dives into more administration topics like backup and restore, credentials, policies, jobs.Additional development and BI-specific topics are also explored, including deploying and downloading assemblies, BLOB data, SSIS packages, and SSRS reports. A short PowerShell primer is also provided as a supplement in the Appendix, which the database professional can use as a refresher or occasional reference material. Packed with more than 100 practical, ready-to-use scripts, "SQL Server 2012 with PowerShell V3 Cookbook" will be your go-to reference in automating and managing SQL Server.
Table of Contents (21 chapters)
SQL Server 2012 with PowerShell V3 Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Resources
Index

Installing Windows Server 2008 R2 as Guest OS


To install the operating system, we first need to mount the Windows Server ISO and play the virtual machine. After that, we can follow the installation wizard.

  1. Launch VMWare Player. Go to Start | VMWare | VMWare Player.

  2. Select SQL2012VM and then select Edit virtual machine settings, as shown in the following screenshot:

  3. Let's increase the memory settings—adjust this based on your available hardware configurations. For our purposes we will increase memory to 2 GB (or 2048 MB), but you can definitely set this higher if you wish. Just make sure you have enough memory still left for your host OS, and other VMs that you may be running simultaneously.

  4. Select CD/DVD, and choose the Use ISO image file radio button. Navigate to Windows Server 2008 R2 ISO, and click on OK.

  5. Go back to the main VMWare Player screen and, while SQL2012VM is selected, click on Play Virtual Machine.

  6. Since we have mounted the ISO, the Windows Server installation screen will be displayed when the VM starts. Now we will need to follow the installation for Windows Server 2008 R2.

    For the installation language we will use English, and keyboard will be US.

    When prompted to install, select Install Now.

  7. When asked about the operating system to install we will choose Windows Server 2008 R2 Standard x64, but feel free to choose a different edition that you want to explore.

  8. Accept the license terms, and click on Next.

  9. When prompted for the type of installation, select Custom.

  10. In the Install Windows dialog, select Disk 0 Unallocated space.

  11. Let the installation complete. Note that the VM will be restarted a few times by the installation process.

  12. In one of the restarts you will be prompted to change the password.

    Provide the administrator password as shown in the following screenshot:

    When done, click on the arrow. This will log you in to your new VM.

  13. By default, the Initial Configuration Tasks screen will be displayed when you first log in.

  14. Under the Provide Computer Information section, click on Provide computer name and domain and set the following options:

    a. In the Computer description, type SQL2012 VM.

    b. Click on the Change button.

    c. In the Computer name textbox, type KERRIGAN.

    Click on OK, and then Apply. You will be prompted to restart the VM; choose Restart Later.

  15. Activate windows. Leave the Serial Number textbox blank, and click Activate.

  16. Restart the VM.

  17. We are almost ready. We just need to install the updates. Go to Start | Windows Update.

  18. Click on Let me choose my settings, the link below Turn on automatic updates. By doing this, we will disable automatic, ongoing updates for this VM.

  19. Under Important Updates, choose Never check for updates and click on OK.

  20. Click on check for updates and install all the critical and relevant updates. When asked to install Internet Explorer 9, install it.

  21. When prompted to restart, click on OK. Once the VM has restarted, log in using VM | Send Ctrl + Alt + Delete.

  22. Now let's disable the firewall. We are only doing this for our development VM. Go to Administrative Tools | Server Manager.

  23. Under the section Customize This Server go to Configure Windows Firewall and disable the firewall.

  24. On the left-hand side pane, select Turn Windows Firewall on or off.

  25. In the Customize Settings dialog, choose to turn off Windows firewall for both private and public networks.

  26. Now let's disable IE Enhanced Security Configuration. Go to Start | Administrative Tools | Server Manager.

  27. Under the Security Information section, click on Configure IE ESC located on the top-right box, as shown in the following screenshot:

  28. Select Off for both Administrators and Users. Click on OK.