Making PowerShell Useful Real-Life Examples of Powershell in

Making PowerShell Useful Real-Life Examples of Powershell in

Making PowerShell Useful Real-Life Examples of Powershell in Action Rob Sewell http://sqldbawithabeard.com Agenda Who 1 Why 2 3 What Rob Sewell http://sqldbawithabeard.com Where 4 How 5 6

Finally 1 Who am I? Email: [email protected] om Twitter: fade2blackuk Rob Sewell http://sqldbawithabeard.com Profile: Rob Sewell Blog: sqldbawithabeard.co m 2 What is PowerShell? According to MSDN Click Here Behind the

Scenes Powering the GUI Remote Management Rob Sewell http://sqldbawithabeard.com Two-Faced Its a Shell Its a Scripting Language Replacing the GUI Server Core Azure Paas 3 Why use PowerShell? What I want to be doingWhat 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* Rob Sewell http://sqldbawithabeard.com Answering the phone Answering Email Performing mundane repetitive tasks 3 Why use PowerShell? The Answer? AUTOMATE EVERYTHING G t N o I n N s R i A

e l l c W r e u h o S s r e e r e w s Y o u L P d N l O u

o e h h s t u o y I read a post by @SQLBrit 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 Rob Sewell http://sqldbawithabeard.com 3 Why use PowerShell? make repetitive tasks easier and less tedious. automate tasks and reduce the risk of human error. Rob Sewell http://sqldbawithabeard.com

make complex tasks less complex by wrapping several commands together. Disaster Recovery 3 Why use PowerShell? My Functions e s a b ta a D A d n i F Search All SQL Error Logs

Show p u SQL S k c a B make complex tasks se a b ervice a t a D t s s Show La S how P make repetitive tasks less complex by r

o cesse make repetitive tasks easier and SQL Error Log Show s On easier and less tedious. wrapping several Serve D less tedious. atabase r s commands together. Add Users Create Windows Account To Role s n Write Functions that work in your o issi

m r e P ns o s i r s e s i environment to answer your Us rm e A P r w e ho Squestions erv S

w Sho g Create SQL Account ent Lo vand E automate tasks s w o d n Show Wi reduce the risk of Drop A User Check A Users Logins human error. Check Disk Space Sh ow Last Backup s On Se rver Services t

r a t S ic t a Show Autom Rob Sewell http://sqldbawithabeard.com 4 How Repetitive Tasks Demo Rob Sewell http://sqldbawithabeard.com 4 How That looks Difficult How will I learn that? How can I learn the syntax Can I make that easier? Use CTRL + J

Rob Sewell http://sqldbawithabeard.com 4 How I can write scripts and functions But I work in a Team Do I have to teach them? Can you make it easier Rob Sewell http://sqldbawithabeard.com 4 How I can write scripts and functions ? Demo Can you make it easier Rob Sewell http://sqldbawithabeard.com 4 How Complex Tasks The Service needs a Database which uses

Availability Groups for HADR The System that Creates the data cannot be exposed externally r u o y r y o r f e e v b o y c a e There is a scheduled R m

Errors introduced by r r k window where datae O o t manual refreshes s o refreshes a are B s cost money i n required D u R Rob Sewell http://sqldbawithabeard.com 4 How Complex Tasks The System that

Creates the data cannot be exposed externally The Service needs a Database which uses Availability Groups for HADR Demo There is a scheduled window where data refreshes are required Rob Sewell http://sqldbawithabeard.com Errors introduced by manual refreshes cost money 5 Where Can I Find Out More? Windows PowerShell Reference on MSDN http://powershell.org/ Hey Scripting Guy Powershell Magazine

Script Center Pluralsight Laerte Junior Simple Talk DBA Stack Exchange And Many More!! (I have missed loads) Rob Sewell http://sqldbawithabeard.com 6 Hopefully 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 Rob Sewell http://sqldbawithabeard.com

6 Questions Rob Sewell http://sqldbawithabeard.com Contact Me Email: [email protected] om Twitter: fade2blackuk Rob Sewell http://sqldbawithabeard.com Profile: Rob Sewell Blog: sqldbawithabeard.co m

Recently Viewed Presentations

  • Placement of Aeroneb with HFOV

    Placement of Aeroneb with HFOV

    Placement of Aeroneb with HFOV Jim Fink, PhD, RRT, FAARC [email protected] High Frequency Oscillation Ventilation : In Vitro Setup Infant Ventilation Demers et al. ATS San Diego, 2005 Aerosol Deposition 10.25±6.0% Effect of Nebulizer Position on Aerosol Delivery with HFOV...
  • Parallele Programmierung

    Parallele Programmierung

    Dynamische Aufgabenverwaltung Merkmale: zentrale Aufgabensammlung (work pool) identische Arbeitsprozesse auf verschiedenen Prozessoren Operation "getwork" zur Anforderung neuer Aufgaben
  • Παρουσίαση του PowerPoint

    Παρουσίαση του PowerPoint

    Η γνώση βασικών κανόνων ασφάλειας και η ανάπτυξη κριτικής σκέψης είναι καθοριστικοί παράγοντες για την προστασία μας από κακόβουλους ανθρώπους και τη διαφύλαξη των προσωπικών μας δεδομένων, ώστε να μπορούμε να ...
  • To His Coy Mistress by Andrew Marvell Born

    To His Coy Mistress by Andrew Marvell Born

    Born in Hull in 1621. At the age of 12, he began his studies at Trinity College, Cambridge. His studies were brought to an abrupt end when he was 20 with his father's death.
  • April 6th-10th Warm-ups

    April 6th-10th Warm-ups

    April 6th-10th Warm-ups Monday, April 4th Warm-up See how many bird names you can unscramble. ulgl rnwe onol cowrhccikeade ocpkrdeewo bacbrildk gnioep csiohrt tskor ancflo Tuesday, April 5th Warm-up How well do you know your sports terminology?
  • PowerPoint-presentasjon - Skild

    PowerPoint-presentasjon - Skild

    AMV A/S Offshore . AMV has been manufacturing, developing and refurbishing advanced oil and gas industry equipment for 40 years. Focusing on products like derrick drilling machines, top drives, hydraulic power packs, drill floor manipulators, racker arms, roughnecks, injectors and...
  • Spanning Trees - University of Pennsylvania

    Spanning Trees - University of Pennsylvania

    Spanning Trees Spanning trees Suppose you have a connected undirected graph Connected: every node is reachable from every other node Undirected: edges do not have an associated direction ...then a spanning tree of the graph is a connected subgraph in...
  • HUDSON BREAKFAST & LUNCH 9/30 to 10/6/2019 Breakfast

    HUDSON BREAKFAST & LUNCH 9/30 to 10/6/2019 Breakfast

    Dinner. Dinner. Dinner. Dinner. Baked Ham. Scalloped Potatoes. Honey Glazed Carrots. Vegetarian Choice: Brown Rice Risotto with Mushrooms. HUDSON DINNER 9/30 to 10/6