James Boother Blog: INTRODUCTION TO POWERSHELL.

Slides:



Advertisements
Similar presentations
Rick Toner MCSD, MCPD, MCITP Blog:
Advertisements

$$ Idea Updatable help system Method overload discovery HelpUri attribute support HelpFile property on FunctionInfo Simplified Where and.
SOFTWARE PRESENTATION ODMS (OPEN SOURCE DOCUMENT MANAGEMENT SYSTEM)
Automating Common DBA Tasks
Jason Himmelstein, MVP Senior Technical Director,
Automating SQL Buildouts With Hyper-V and SQL Server 2008 R2 Robert L Davis, Sr. DBA, Microsoft Corp.
James Boother Blog: AUTOMATING ADMIN TASKS WITH POWERSHELL.
SharePoint 2010 Administration using PowerShell Brian Caauwe Senior Consultant – SharePoint – MCTS March 20, 2010.
Daniel Petri MVP, Microsoft Infrastructure Manager John Bryce Training November 2007.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
Microsoft Office Project 2003 Resource Kits James Scott & Roy Riley Technical Content Development Microsoft Corporation.
VMware vCenter Server Module 4.
4/19/2017 7:23 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Connect with life L.Srividya Architect Advisor | Microsoft India.
Enterprise Reporting with Reporting Services SQL Server 2005 Donald Farmer Group Program Manager Microsoft Corporation.
System Center 2012 R2 Windows Azure Pack Service Management Automation 101.
Module 16: Software Maintenance Using Windows Server Update Services.
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
MS WINDOWS POWER SHELL CSE 535 Operating Systems.

Microsoft ® Official Course Module XA Using Windows PowerShell ®
Appendix A Starting Out with Windows PowerShell™ 2.0.
Drupal Jumpstart Information Systems 337 Prof. Harry Plantinga.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
Windows Small Business Server 2003 Setting up and Connecting David Overton Partner Technical Specialist.
Section 6: Using Windows PowerShell to Manage Group Policy Introducing Windows PowerShell Windows PowerShell Library for Group Policy Windows PowerShell-Based.
December, 21, 2010 Bartek Bielawski Sr IT Site Services Specialist Warsaw, Poland.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
Introduction to Windows PowerShell DANIEL HIBBERT PRIMER FIELD ENGINEER DMVMUG User Conference 2013 – Reston, VA.
Good Morning and Thank You!.  Have some Fun!  Learn at least one thing new!  Make myself available to you So please …  Ask questions and enjoy!
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Online Conference June 17 th and 18 th SharePoint Online Administration with PowerShell.
Protecting SharePoint with System Center Data Protection Manager 2007 Chris Whitehead Premier Field Engineer Microsoft UK.
Windows PowerShell Introduction 1 Morgan Simonsen Ementor.
 An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is.
CIS 1402: Intro to CIS Tom Gustafson. Facts About PowerShell PowerShell is Microsoft’s command-line interface that provides scripting and management capability.
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
POWERSHELL ABOVE AND BEYOND: GUIS, WORKFLOWS, AND MORE Dean Corcoran Partner Service Account Manager (Cloud) – MCT – MCITP:EA Microsoft Australia SESSION.
Introduction to SQL Server  Working with MS SQL Server and SQL Server Management Studio.
 Version 1.0[edit]edit  Version 1.0 was released in 2006 for Windows XP SP2/SP3, Windows Server 2003,
Rob Sewell Making PowerShell Useful Real-Life Examples of Powershell in Action Slides available here -
Automation Build TFS 2010 Trainer: Eran Ruso. Training Agenda Team System Introduction SCM – Classic – Feature Crus Team Build 2010.
Introduction to SQL Server Automation with Powershell by Chris Sommer.
Ravikanth C.
Exploreengage elevate explore engage elevate Presented By: Laura Murphy, Turnkey Technologies.
Productivity Architect Meet Chris Bortlik Author, Blogger, Speaker.
PowerShell 5 & Windows 10. What are we covering today? What is PowerShell? Why is PowerShell important? Some simple demos on Windows 10.
SQL Database Management
Start-SPPowerShell – Introduction to PowerShell for SharePoint Admins and Developers Paul BAker.
How to Start SQL Server and SSDT BI in Local
Stress Free Deployments with Octopus Deploy
Shared Services with Spotfire
Introduction to PowerShell
TechEd /3/2018 4:18 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Deploying and Configuring SSIS Packages
Fun with Reporting Services Tools
Getting Started with the Data ONTAP PowerShell Toolkit
Introduction to PowerShell
SharePoint Saturday Omaha April 2016
Perl for Bioinformatics
Making PowerShell Useful
dbatools - PowerShell and SQL Server Working Together
Getting started with Powershell for the DBA
PowerShell Best Practices for SQL DBA’s
Making PowerShell Useful
Use PowerShell & dbatools to Manage your SQL Server Environment
Presentation transcript:

James Boother Blog: INTRODUCTION TO POWERSHELL

AGENDA A brief history lesson Don’t be scared everything’s familiar What’s new in 2.0? Scripting IDE’s Profiles Cmdlets and Variables Providers Resources

IN THE BEGINNING…

AFTER YEARS OF RESEARCH POSH WAS BORN

HOW DO I GET POWERSHELL INSTALLED? PowerShell 2 Pre-Installed on Windows 7 and Windows Server 2008 R2 Can be installed on Windows XP and Windows Server 2003 & 2008 Download from - Windows Management Frameworkhttp://support.microsoft.com/kb/968929

YOU CAN USE FAMILIAR COMMANDS Demo

WHAT’S NEW IN VERSION 2? Remoting Integrated Scripting Environment Modules Advanced functions Background jobs Eventing Script internationalisation Script debugging New cmdlets

SCRIPTING IDES Notepad++ Microsoft’s Interactive Scripting Environment (Part of PowerShell 2) PowerGui Visual Studio VSX – Adam Driscoll

NOTEPAD ++

MSFT INTERACTIVE SCRIPTING ENVIRONMENT

POWERGUI.ORG

VISUAL STUDIO VSX

GETTING HELP Get-Help commandlet F1 in ISE Autocomplete in PowerGui & VSX Visual Search on Bing

POWERSHELL PROFILES A PowerShell script that is run by the PowerShell host on launch I’ve created a global profile to be run by all users and all hosts Create C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 Why? Add Visual Studio Environment Variables Add SQL Server Environment Variables Load Dlls into memory

CMDLETS Main building block of PowerShell Scripts Mini Commands that perform one action Common naming convention: Verb then Noun e.g.: Get-Help, Get-Object, Remove-Item Actually.NET Classes that can easily be created if new functionality is required The output of one Cmdlet can be piped into further cmdlets using the | operator Destructive CmdLets have –WhatIf parameter

REALTIME LOG FILE MONITORING Demo

VARIABLES Defined by a name prceeded by a dollar sign (“$”) When working in the pipeline (“$_”) is the current item A single equals character is used for assignment e.g. $a = 1 or $a = $b Equality test with expressions such as –eq –ne –gt –ge –lt –le –like –and -or Strings in double quotes automatically replace variables with their value. To prevent this from happening use single quotes ‘Some test $no replacement here” If you want to include carriage returns format your string like this

PROVIDERS Providers are.net libraries. The SQL Server team created a provider ProviderDescription Alias ProviderProvides access to the Windows PowerShell aliases and their values Certificate ProviderProvides read-only access to X509 certificate stores and certificates Environment ProviderProvides access to the Windows environment variables FileSystem ProviderProvides access to files and directories Function ProviderProvides access to the functions defined in Windows PowerShell Registry ProviderProvides access to the system registry keys and values Variable ProviderProvides access to Windows PowerShell variables and their values WSMan ProviderProvides access to WSMan configuration information

NAVIGATING A DATABASE WITH SQL PROVIDER Demo

WMI SCRIPT Full access to WMI from within Powershell:

DELETING OLD BACKUP FILES

A FEW SQL MAINTENANCE SCRIPTS

SCHEDULING SCRIPTS SQL Server Agent or windows Task Scheduler

SUMMARY Powerful object based scripting engine Backwards compatible so you can start from what you already know Full access to File System; Registry; WMI; COM;.NET Objects and SQL Server Simple to schedule using Windows Scheduled Tasks or SQL Jobs Extensible through.NET

WEB RESOURCES Master-PowerShell | With Dr Tobias Weltner The Scripting Centre PowerShell owners manual PowerShell team blog Adam Driscoll – Visual Studio PowerGUI VSX - Setting SQL Environment Variables Powershell-outside-of-SQLPS.aspx

BOOKS

QUESTIONS If you have any questions now’s your chance…

THANK YOU Thank you for attending Automating admin tasks with PowerShell if you have any further questions please see my contact details here: Blog: Happy scripting!