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

Configuring a domain controller


In a production environment, it is not recommended to install the domain controller with any of your other server software.

Note

Note that this section is optional. You do not need to configure a domain controller to start using the recipes in this book.

For development and testing purposes (such as ours), however, we will install them on the same machine. Should you want to mimic a production setup, you can create another Windows Server 2008 R2 VM with a different computer name, and follow the steps given:

  1. Launch VMWare Player.

  2. Play SQL2012 VM.

  3. Log in to our VM, KERRIGAN.

  4. Go to Administrative Tools | Server Manager.

  5. Click on Add roles. This will launch the Add Roles Wizard dialog.

  6. In the Select Server Roles screen, choose Active Directory Domain Services. This action will trigger the display of another window prompting if you want to install required features. Click on Add Required Features.

  7. Click on Next in the Introduction to Active Directory Domain Services window.

  8. Click on Next in the Confirm Installation Selections window.

  9. When done, view the results. Note that you will get a warning because we disabled automatic updates. For our purposes, this is acceptable.

  10. To configure the domain, go to Start and in the textbox type dcpromo and press Enter. This will start the Active Directory Domain Services Installation Wizard application.

  11. Click on Next on the wizard until you hit the Deployment Configuration window. Select Create a new domain in a new forest.

  12. In the Name the Forest Root Domain window, type queryworks.local in the FQDN of the forest root domain textbox.

  13. For Forest functional level, select Windows Server 2008 R2 and click on Next.

  14. In the Additional Domain Controller Options window, select DNS server as shown in the following screenshot:

  15. You will receive a warning about the computer having a dynamically assigned IP address. Click on Yes, the computer will use an IP address automatically assigned by a DHCP server. For our purposes, this is acceptable. Note that if this option is chosen, it is assumed that a DHCP server is already available on the network. Otherwise, the server will use an APIPA scheme, or Automatic Private IP Addressing, which does not work well with domain controllers.

  16. Another warning dialog will appear, informing you that delegation for the DNS server cannot be created. Click on Yes to continue.

  17. Accept the default folders for Location for database, log files, and SYSVOL.

  18. Type the password.

  19. Review the Summary of your selections.

  20. Finish the installation process of the wizard. When done, you will be prompted to restart as shown in the following screenshot:

  21. Once the Virtual Machine is back online, you will notice that the login screen no longer shows KERRIGAN\Administrator. It should now show QUERYWORKS\Administrator.