The Dirty Dozen: PowerShell Scripts for the Busy DBA DBA-237 Aaron

Slides:



Advertisements
Similar presentations
Windows PowerShell Crash Course Don Jones Concentrated Technology Jeffrey Snover Microsoft WSV321.
Advertisements

Turning PowerShell Commands into Reusable CLI and GUI Tools Don Jones Senior Partner and Principal Technologist Concentrated Technology, LLC WCL404.
Calendar Browser is a groupware used for booking all kinds of resources within an organization. Calendar Browser is installed on a file server and in a.
Automating SQL Buildouts With Hyper-V and SQL Server 2008 R2 Robert L Davis, Sr. DBA, Microsoft Corp.
James Boother Blog: INTRODUCTION TO POWERSHELL.
James Boother Blog: AUTOMATING ADMIN TASKS WITH POWERSHELL.
Social Computing for the Database Professional Jason Massie, Terremark Brent Ozar, Quest Software.
Gather SQL Server Performance Data with PowerShell
Managing a “0 Downtime” Shop Session Code Session Title About Me 15 years as a DBA (Wells Fargo, Anthem, Yellow Pages, Pulte…) SQL.
Denny Cherry twitter.com/mrdenny.
Introduction Paul Turley SqlServerBiBlog.com Mentor, SQL Server MVP
SOUL INSTALLATION Step-1 For this Please Install the Version 7.0 or SQL Server 2000 or onwards.
WMU GNL Automation How to make my IT life easier CHRISTOPHER KEYAERT CONSULTANT AT INOVATIV CLOUD AND DATACENTER MANAGEMENT MVP.
Connect with life L.Srividya Architect Advisor | Microsoft India.
© 2007 Asynchrony Solutions, Inc. 1 10/29/07 Introduction to PowerShell Brian Button VP Engineering Asynchrony Solutions, Inc
PowerShell for Data Professionals PowerShell 2.0 brings a lot of functionality to help you automate interaction with you servers. 2.0 itself brings a script.
The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA Ike Ellis.
PowerShell for Windows Admins By Aaron Nelson *(Mostly) SQLvariant.com My Blog SQLPowerShell.com PowerShell specific blog posts I’m not a PowerShell Expert.
PowerShell for Data Professionals By Aaron Nelson *(Mostly) SQLvariant.com My Blog SQLPowerShell.com PowerShell specific blog posts I’m not a PowerShell.
PowerPoint Twitter Tools Technology Coach Meeting – May 4, 2012.
David V. Ecker Stony Brook and Client Support Stony Brook University Located 60 miles east of New York City 22,000 students, 10,000.
PowerShell and SQL Server References. References - PowerShell  Windows PowerShell In Action Second Edition, Bruce Payette, Manning  Windows PowerShell.
October 11-14, Seattle, WA Top 10 Ways To Break Your Deployments Or: How to Avoid Your Sorry Fate Dev Nambi Senior Software Engineer Microsoft.
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Migrating Data to SQL Azure Arunraj Chandrasekaran Twitter June 21, 2011.
Ch 2. Creating and Configuring Databases. SQL Server Management Studio (SSMS) Graphical way to create / manage SQL Server Combines features from Query.
Get-Intro –Name PowerShell Jason Helmick Systems Instructor Interface Technical Training.
SQL Server PowerShell Extensions Aaron Nelson SQLvariant.com My Blog SQLPowerShell.com PowerShell specific blog posts.
Asif Rehmani Trainer SharePoint-eLearning.com OFC 301.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
Cool Tricks to Pull from Your SSIS Hat Julie Smith.
Rob Sewell Making PowerShell Useful Real-Life Examples of Powershell in Action Slides available here -
Using Power BI with my DBA Database
Introduction to SQL Server Automation with Powershell by Chris Sommer.
Business Connectivity Services BCS (Old BDC) New read and write access to external data –Line-of-business (LOB) systems –Web services –Databases –Other.
Making the GUI work for you Tibor Karaszi
Allan Hirt – Megahirtz LLC
SQL Server® Always On Series: Part 2: SQL Server® Failover Clustering Deep Dive Max Verun, Farzan Ratistari, Ahmed Bisht – Microsoft® Corporation.
Welcome to the 2012 Learning 2.0 Conference!
Achieve more in less time using the new SQL PowerShell
PowerShell is Happening FOR REAL THIS TIME!!!
Jim Nakashima Program Manager – Cloud Tools Microsoft Corporation
Documentation – you know you love it
Automating AD Administration with Windows PowerShell
Visual Studio 2010 Database Projects
Microsoft Ignite /17/ :56 PM
Microsoft Ignite /21/2018 8:47 AM
Auditing in SQL Server 2008 DBA-364-M
Getting To Know Your Indexes
Making PowerShell Useful
Visual Report Design Bringing Sexy Back Paul Turley Mentor, SolidQ.
PowerShell for Data Professionals
SQL Server and PowerShell Let’s Get Serious
The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA
PowerShell Best Practices for SQL DBA’s
Making PowerShell Useful
Automating the install and upgrade of SQL scripts
TechEd /18/2019 2:43 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Parameter Sniffing: the Good, the Bad, and the Ugly
Parameter Sniffing: the Good, the Bad, and the Ugly
Use PowerShell & dbatools to Manage your SQL Server Environment
TechEd /23/2019 9:23 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Governing Your Enterprise with Policy-Based Management
Advanced Dashboard Creation with PerformancePoint Services 2010
Michael Wall Senior DBA, Great Western Malting
TechEd /28/ :34 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Michelle Haarhues Keeping up with SSMS.
Using Dbatools to Automate Database Migrations
TechEd /30/2019 7:18 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Presentation transcript:

The Dirty Dozen: PowerShell Scripts for the Busy DBA DBA-237 Aaron

DBA 2378 The Dirty Dozen: PowerShell About Me: I’ve been working with databases for over 10 years I’m, a Second Generation DBA I blog at SQLvariant.comSQLvariant.com All of the scripts shown here are available on my blog. Please download the scripts and follow along if you have your laptop with you.

DBA 2378 The Dirty Dozen: PowerShell Why PowerShell? “It’s always useful to keep in mind that PowerShell is not “just” a shell or scripting language. Its primary purpose is to be an automation tool for managing Microsoft Windows.” – Bruce Payette Windows PowerShell in Action Second Edition

DBA 2378 The Dirty Dozen: PowerShell PowerShell Bolt-Ons or “Expansion Packs” In addition to the out of the box PowerShell features there are some ‘expansion packs’ in the form of Snap-Ins and Modules The Snap-Ins for SQL Server come with SSMS and they are SqlServerCmdletSnapin100 SqlServerProviderSnapin100

DBA 2378 The Dirty Dozen: PowerShell THE Module for SQL Server is SQLPSX SQLPSX.CodePlex. com

DBA 2378 The Dirty Dozen: PowerShell How Many of You Like Repetitively Clicking Around SSMS?

DBA 2378 The Dirty Dozen: PowerShell How Many People Here Are Already Using PowerShell?

DBA 2378 The Dirty Dozen: PowerShell How Many People Here Are Developers?

DBA 2378 The Dirty Dozen: PowerShell Please Fill Out the Survey Form!!

DBA 2378 The Dirty Dozen: PowerShell What’s this Methods & Properties Business? Methods are just verbs : Like Drop Table Properties are adjectives: Like Auto- Shrink Enabled NEVER DO THIS

DBA 2378 The Dirty Dozen: PowerShell Deciphering PowerShell $SomeTable is a variable Drop-Database (Verb-Noun) is how cmdlets (and most functions) are named SQLSERVER:\sql\D2\R2\DATABASES\ Provider Path $SomeTable.Script() This is a Method being used on an object (in this case the object is a variable)

DBA 2378 The Dirty Dozen: PowerShell Variables in PowerShell Get “Expanded” = = 'SELECT * FROM $DataBaseName="ReportServer" invoke-sqlcmd -query "SELECT * FROM $DataBaseName.INFORMATION_SCHEMA.COLUMNS" ` -ServerInstance D2 -database master

DBA 2378 The Dirty Dozen: PowerShell Deciphering PowerShell This is a.Net thingie [System.Reflection.Assembly]::LoadWithPartial Name("Microsoft.SqlServer.Smo") This is another a.Net thingie [Microsoft.SqlServer.Management.Smo.Smo Application]::EnumAvailableSqlServers()

DBA 2378 The Dirty Dozen: PowerShell Deciphering PowerShell So tell me about yourself: Get-Help is how you find out more about a cmdlet or a function (that has help available) Get-Member is not just a bad Austin Powers joke the Dev team left laying around. It’s how you find out all of the Methods and Properties of an object

DBA 2378 The Dirty Dozen: PowerShell If you need help please reach out on twitter and use the #PoShHelp hashtag Also, the #PowerShell tag is great for finding out news about PowerShell. It is VERY widely followed.

DBA 2378 The Dirty Dozen: PowerShell If you want to see more slides you better leave now because it’s all scripts from here

DBA 2378 The Dirty Dozen: PowerShell Complete the Evaluation Form to Win! Win a Dell Mini Netbook – every day – just for handing in your completed form. Each session evaluation form represents a chance to win. Pick up your evaluation form: In each presentation room At the PASS Booth near registration Drop off your completed form: Near the exit of each presentation room At the PASS Booth near registration Sponsored by Dell

Thank you for attending this session and the 2010 PASS Summit in Seattle