Presentation is loading. Please wait.

Presentation is loading. Please wait.

Making PowerShell Useful

Similar presentations


Presentation on theme: "Making PowerShell Useful"— Presentation transcript:

1 Making PowerShell Useful
Real-Life Examples of Powershell in Action Slides available here -

2 Thank you to our AWESOME sponsors!

3 Agenda 1 2 3 4 5 6 Who Why Where What How Finally
Just so you know what is happening today a quick agenda Who What Why How Finally

4 Twitter: sqldbawithbeard
Who am I? 1 Profile: Rob Sewell Twitter: sqldbawithbeard Blog: sqldbawithabeard.com Just to show you how to contact me – You don’t need any more than that

5 What is PowerShell? 2 According to MSDN Two-Faced Behind the Scenes
It’s a Shell It’s a Scripting Language Click Here Behind the Scenes Replacing the GUI Ask what is Powershell and you will get a thousand different answers MSDN says It’s a Shell, everything you can do in CMD you can do in PS and you can use UNIX Aliasis too like ls rm etc but your outputs are .NET objects It’s a language so you can create your own tools Microsoft are using it and will continue to use it – It powers many GUIS and enables you to do things the GUI cannot in Exchange, Active Directory and especially in Azure There is no GUI -= Server Core is getting more popular and In the October 2009 issue of TechNet Magazine, Microsoft says, "It's safe to say that the single most important skill a Windows administrator will need in the coming years is proficiency with Windows PowerShell." Server Core Azure Paas Powering the GUI Remote Management

6 Why use PowerShell? 3 What I want to be doing What I end up doing
Building New Shiny Things Exploring the best way to solve that ………. Concentrating on writing and testing that complex procedure/script Completing documentation* Answering the phone Answering Performing mundane repetitive tasks

7 WARNING – PowerShell is not the ONLY resource you should use
Why use PowerShell? 3 AUTOMATE EVERYTHING I read a post The Best DBAs Automate everything I automate as much as is feasibly possible mostly through PowerShell Backups and restores through Dev/SAT/FAT/UAT/Live environments Daily Backup Checks, Drive Space Checks, Service Running Checks, File Space Checks, Failed Agent Job Checks, SQL Error Log Checks, DBCC Checks and more The Answer? WARNING – PowerShell is not the ONLY resource you should use Automate from wikipedia Automation is the use of machines, control systems and information technologies to optimize productivity in the production of goods and delivery of services

8 Why use PowerShell? 3 Disaster Recovery
make repetitive tasks easier and less tedious. make complex tasks less complex by wrapping several commands together. automate tasks and reduce the risk of human error. Disaster Recovery

9 My Functions Why use PowerShell? 3 Find A Database Check Disk Space
Search All SQL Error Logs Find A Database make repetitive tasks easier and less tedious. make complex tasks less complex by wrapping several commands together. Show Last Database Backup Show SQL Services make repetitive tasks easier and less tedious. Write Functions that work in your environment to answer your questions SQL Error Log Show Processes On Server Show Databases Create Windows Account Add Users To Role Show A Users Permissions automate tasks and reduce the risk of human error. Show Server Permissions Create SQL Account Show Windows Event Log Check A Users Logins Drop A User Check Disk Space Show Last Backups On Server Show Automatic Start Services

10 How – Repetitive Tasks 4 Demo

11 How 4 Use CTRL + J How can I learn the syntax Can I make that easier?
That looks Difficult How will I learn that? How can I learn the syntax Can I make that easier? Use CTRL + J

12 I can write scripts and functions
How 4 I can write scripts and functions But I work in a Team Do I have to teach them? Can you make it easier

13 I can write scripts and functions
How 4 I can write scripts and functions ? Demo Can you make it easier

14 Or maybe for your Disaster Recovery Run Book
How – Complex Tasks 4 The Service needs a Database which uses Availability Groups for HADR The System that Creates the data cannot be exposed externally Or maybe for your Disaster Recovery Run Book There is a scheduled window where data refreshes are required Errors introduced by manual refreshes cost money

15 How – Complex Tasks 4 The Service needs a Database which uses Availability Groups for HADR The System that Creates the data cannot be exposed externally Demo There is a scheduled window where data refreshes are required Errors introduced by manual refreshes cost money

16 Where Can I Find Out More?
5 Windows PowerShell Reference on MSDN Hey Scripting Guy Powershell Magazine Script Center Pluralsight Laerte Junior Simple Talk DBA Stack Exchange And Many More!! (I have missed loads)

17 Hopefully 6 You have learnt You can use Powershell
How to create a function CTRL + J How to pass on Knowledge to your team How to set up more complex scripts Where to go for more help

18 Questions 6

19 Twitter: sqldbawithbeard
Contact Me Profile: Rob Sewell Twitter: sqldbawithbeard Blog: sqldbawithabeard.com Just to show you how to contact me – You don’t need any more than that SQL SATURDAY EXETER 12th March 2016 Open for Registrations and Session Submissions Come and Ask me if you have Questions


Download ppt "Making PowerShell Useful"

Similar presentations


Ads by Google