Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA

Similar presentations


Presentation on theme: "The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA"— Presentation transcript:

1 The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA
12/25/ :51 PM DBI331 The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA Aaron Nelson Data Architect © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 About Me Aaron Nelson SQLvariant.com @SQLvariant

3 Talking SQL Server from PowerShell
TechEd 2012 12/25/ :51 PM Talking SQL Server from PowerShell There are several different approaches to working with SQL Server from PowerShell Windows PowerShell Cmdlets WMI .NET SQL Provider SQL PowerShell ADO.NET SMO © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 The SQL Server 2012 PowerShell Provider
TechEd 2012 12/25/ :51 PM The SQL Server 2012 PowerShell Provider Once you’re inside the SQL Server Provider for PowerShell you have a lot of options besides just working with databases inside of the Relational Engine Database Engine Policy Management Registrations Data Collection Server Extended Events Utility Integration Services Analysis Services © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 PowerShell for SQL Server Traversing the SQLSERVER:\SQL\ Provider 101
TechEd 2012 12/25/ :51 PM PowerShell for SQL Server Traversing the SQLSERVER:\SQL\ Provider 101 If you know how to navigate Object Explorer in SSMS you already know how to navigate the SQL Server PowerShell Provider To navigate to an instance it looks like this: SQLSERVER:\SQL\LocalHost\Default\Databases To get to a named instance on a remote server it’s like this: SQLSERVER:\SQL\ProdSQL01\R2\Databases © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 SQLPSX make things easy on yourself. Download this now!
TechEd 2012 12/25/ :51 PM SQLPSX make things easy on yourself. Download this now! First: Don’t Script, write PowerShell Functions instead Second: Don’t write code directly against the SMO if you can avoid it. Chad Miller is better than you. See for yourself… CodePlex: SQLPSX.codeplex.com © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 12 PowerShell scripts for working with SQL Server 2012

8 mva Track Resources SQL Server 2012 Eval Copy Hands-On Labs @sqlserver
@ms_teched mva Microsoft Virtual Academy Get Certified!

9 Resources Learning TechNet http://northamerica.msteched.com
Connect. Share. Discuss. Microsoft Certification & Training Resources TechNet Resources for IT Professionals Resources for Developers

10 Complete an evaluation on CommNet and enter to win!
Required Slide Complete an evaluation on CommNet and enter to win!

11 MS Tag Scan the Tag to evaluate this session now on myTechEd Mobile

12 My Contact Info Aaron Nelson SQLvariant.com @SQLvariant

13 12/25/ :51 PM © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 12/25/ :51 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA"

Similar presentations


Ads by Google