Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology



Similar documents
Microsoft. Jump Start. M3: Managing Windows Server 2012 by Using Windows PowerShell 3.0

Acknowledgments Finding Your Way Around Windows PowerShell p. 1 Getting Started with Windows PowerShell p. 3 Installing Windows PowerShell p.

WolfTech Active Directory: PowerShell

PowerShell for Exchange Admins

SUNGARD SUMMIT 2007 sungardsummit.com 1. Microsoft PowerShell. Presented by: Jeff Modzel. March 22, 2007 Course ID 453. A Community of Learning

Microsoft Windows PowerShell v2 For Administrators

POWERSHELL (& SHAREPOINT) This ain t your momma s command line!

Exploring PowerShell. Using Windows PowerShell

Automating Microsoft

Windows PowerShell Fundamentals

Lab Answer Key for Module 1: Installing and Configuring Windows Server Table of Contents Lab 1: Configuring Windows Server

You Should Be Using PowerShell Aaron Kaiser Senior Technology Support Specialist Parkway School District

Forefront Management Shell PowerShell Management of Forefront Server Products

Things I wish I d known when I started using PowerShell

Troubleshooting File and Printer Sharing in Microsoft Windows XP

Intel vpro Technology Module for Microsoft* Windows PowerShell*

POWERSHELL FOR NEWBIES Getting started with PowerShell 4.0. Jeffery Hicks

PowerShell for Dummies

# Demo: jak to działa?

Windows PowerShell Essentials

Microsoft Corporation. Status: Preliminary documentation

Using Management Shell Reports and Tracking User Access in the NetVanta UC Server

Powershell Management for Defender

Troubleshoot Using Event Log Mining

Windows Server 2008 R2: Server Management and PowerShell V2

Mod 2: User Management

Note: The scripts in this article should work for XenApp 6 and XenApp 5 for Windows Server 2008 and XenApp 5 for Windows Server 2003.

Avatier Identity Management Suite

Using Windows PowerShell to Manage SharePoint 2010

PowerShell Support in SCAP 1.2. Michael Tan Microsoft Corporation

CAPIX Job Scheduler User Guide

WHITE PAPER POWERSHELL FOR DUMMIES HOW TO KEEP TRACK OF

DEPLOYMENT GUIDE DEPLOYING F5 AUTOMATED NETWORK PROVISIONING FOR VMWARE INFRASTRUCTURE

Automating. Administration. Microsoft SharePoint with Windows. PowerShell 2.0. Gary Lapointe Shannon Bray. Wiley Publishing, Inc.

DiskPulse DISK CHANGE MONITOR

A layman s guide to PowerShell 2.0 remoting. Ravikanth Chaganti

Windows PowerShell. 3.0 Step by Step. Ed Wilson

SQL Server Integration Services with Oracle Database 10g

Active Directory Deployment and Management Enhancements

Deploying System Center 2012 R2 Configuration Manager

Windows PowerShell Cookbook

Course Syllabus. Implementing and Managing Windows Server 2008 Hyper-V. Key Data. Audience. At Course Completion. Prerequisites

Administration Guide. . All right reserved. For more information about Specops Gpupdate and other Specops products, visit

Installation Manager Administrator s Guide

Best Practices for Installing and Configuring the Hyper-V Role on the LSI CTS2600 Storage System for Windows 2008

DELL Remote Access Configuration Tool

Course Syllabus. Configuring and Troubleshooting Internet Information Services in Windows Server Key Data. Audience. At Course Completion

Windows" 7 Desktop Support

Personal Archiving in Exchange Online

Windows 7 Portable Command Guide: MOTS , and MCITP

SPHOL205: Introduction to Backup & Restore in SharePoint Hands-On Lab. Lab Manual

Centralizing Windows Events with Event Forwarding

Staff User s Guide Task Manager. Version 20

Windows PowerShell 2.0

IBM Tivoli Provisioning Manager V 7.1

Dell SupportAssist Version 2.0 for Dell OpenManage Essentials Quick Start Guide

Workflow approval via

Dell One Identity Quick Connect for Cloud Services 3.6.0

Intel vpro Technology Module for Microsoft* Windows* PowerShell* Revision March 2012 Document ID: 1057

Wireshark Developer and User Conference

Configuring and Integrating PowerShell

Fairsail. Implementer. Fairsail to Active Directory Synchronization. Version 1.0 FS-PS-FSAD-IG R001.00

Unidesk 3.0 Script to Increase UEP Size for Persistent Desktops

Question: Hi Everyone! Thank you TEACHERS, MICROSOFT, MVA and Event Support Team for this lesson! Answer: Great to see you POPA DAN!

Dell One Identity Cloud Access Manager How to Configure Microsoft Office 365

What is New Whitepaper. White Paper

Data Warehouse Troubleshooting Tips

End of Sale/End of Life Report Tool Usage Notes for CiscoWorks NCM 1.6

ms-help://ms.technet.2005mar.1033/security/tnoffline/security/smbiz/winxp/fwgrppol...

1.0 Getting Started Guide

HP Device Monitor (v 1.1) for Microsoft System Center User Guide

User Experience Reference Design

AddLocalUser AddLocalGroup AddLocalUserToLocalGroup AddDomainUserToLocalGroup AddDomainGroupToLocalGroup

Introduction to PowerShell by Guy Thomas

User Document. Adobe Acrobat 7.0 for Microsoft Windows Group Policy Objects and Active Directory

Tutorial Guide to the IS Unix Service

Installation Guide. . All right reserved. For more information about Specops Deploy and other Specops products, visit

LockView 4.2 CompX Database & Network Configuration & Installation Manual

Unicenter Patch Management

Partie Serveur Lab : Implement Group Policy. Create, Edit and Link GPOs. Lab : Explore Group Policy Settings and Features

CA Workload Automation Agent for Remote Execution

Managing Linux Servers with System Center 2012 R2

Track User Password Expiration using Active Directory

Monitor Mobile Devices via ActiveSync Using EventTracker

CONFIGURING MICROSOFT SQL SERVER REPORTING SERVICES

Browser Client 2.0 Admin Guide

6422: Implementing and Managing Windows Server 2008 Hyper-V (3 Days)

Dotnet Agent Installation with Remote Management - Powershell Extension Advanced Options

LockView CompX Database & Network Configuration & Installation Manual

CLC Server Command Line Tools USER MANUAL

Integrating VoltDB with Hadoop

DocAve 6 SDK and Management Shell

Polar Help Desk Installation Guide

Test Lab Guide: Creating a Windows Azure AD and Windows Server AD Environment using Azure AD Sync

Cloud Identity Management Tool Quick Start Guide

M86 Authenticator USER GUIDE. Software Version: Document Version:

Lab Sample Solutions. Chapter 3

Transcription:

Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Meet Jeffrey Snover @jsnover Distinguished Engineer & Lead Architect for Windows Server & System Center Division Inventor of Windows PowerShell Responsible for setting long term technical vision for these products and running the technology planning for the releases Over 30 years of industry experience Microsoft, Tivoli, NetView, DEC Held 8 patents prior to joining Microsoft, and has registered 30 since. Frequent speaker at industry and research conferences on a variety of management and language topics

Meet Jason Helmick @thejasonhelmick Senior Technologist, Concentrated Technology Board member and CFO PowerShell.Org Author Learn Windows IIS in a Month of Lunches Contributingauthor PowerShellDeepDives 25 year IT veteran Speaker at a variety of industry conferences Teaches PowerShell for the IT pro to maximize management and automation Frequent contributor to TechNet Magazine and other industry publications

Course Topics Getting Started with PowerShell shellthefeardon t 01 06 The pipeline : Deeper 02 The Help system 07 The Power in the Shell - Remoting 03 The pipeline : Getting connected 08 Getting prepared for automation 04 Extending the shell 09 Automation in scale - Remoting 05 Objects for the Admin 10 Introducing scripting and toolmaking

Setting Expectations Target Audience Tailored for the IT pro that needs to improve management and automation Fast paced for the real world Suggested Prerequisites/Supporting Material Experience working as a Windows IT pro/admin/help Desk Get answers in the forums at PowerShell.Org 3 PowerShellWindowsLearn outcheck by LunchesofMonthain Don Jones and Jeffery Hicks

Join the MVA Community! Microsoft Virtual Academy Free online learning tailored for IT Pros and Developers Over 1M registered users Up-to-date, relevant training on variety of Microsoft products! learnyouwhileearn Get 50 MVA Points for this event! Visit http://aka.ms/mva-voucher Enter this code: PowerJump1 (expires 8/15/2013)

01 shellthefeardon t Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview The purpose for PowerShell Installing PowerShell Windows Management Framework Launching PowerShell for the administrator Customize the shell for comfort Getting familiar with the shell

The Purpose to PowerShell YOU THEM Improved management and automation Manage real-time Manage large scale

Installing PowerShell Windows Management Framework PowerShell V3 Windows 8 and Server 2012 PowerShell V2 Windows 7 and Server 2008 Download the Windows Management Framework 3.0 at http://www.microsoft.com/enus/download/details.aspx?id=34595 Windows XP and Server 2003 can run V2

Launching PowerShell for the Administrator

Customize the shell for comfort

Getting familiar with the shell Cmdlets : Verb Noun Native commands work! Examples Ping, IPConfig, calc, notepad, mspaint cls - Clear-Host cd - Set-Location dir, ls - Get-Childitem type, cat - Get-Content Copy, cp - Copy-item

Questions or comments?

02 The Help system Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview Why you need help Updatable Help Discoverability with the Help system Understanding Syntax Real-World using Help

Why you need help Vast resource at your finger tips to help make you successful memorizedon t Discover! Thousands of cmdlets all have help! Scripting resources and information Advanced PowerShell configuration information

Updatable Help Update to the latest version of Help Save-Help to save to a local location

Discoverability with the Help system Get-Help versus Help and Man Help <cmdlet> Help *partial* Help <verb/noun> Help <cmdlet> -Full Help <cmdlet> -Online Help <cmdlet> -ShowCommand Get-Help About_*

Understanding Syntax Parameter sets The meaning of Syntax - Indicates A Parameter <> Indicates Arguments [] Argument Accepts Multiple Values [Param] is Positional [Param Arg] is Optional

Real-World using Help

Questions or comments?

03 The Pipeline : Getting Connected Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview What s the pipeline and what does it do? Exporting/Importing CSV Exporting/Importing XML Other files and printers Displaying information in a GUI Making a webpage of information Cmdlets that kill

What s the pipeline and what does it do? Pipe character located above the Enter key Connects cmdlets to produce better results Can be broken into several lines to increase readability

Exporting/Importing CSV

Exporting/Importing XML

Other files and printers

Displaying information in a GUI

Making a webpage of information

Cmdlets that kill Stop-Process / kill Stop-service $ConfirmPreference $WhatIfPreference -Confirm -Whatif

Questions or comments?

04 Extending the Shell Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview Like the MMC One Shell does it all Finding and adding Snap-ins Finding and adding Modules Discovering new commands The real world of cmdlets

Like the MMC - One Shell does it all

Finding & Adding Snap-ins

Finding & Adding Modules PowerShell V3 dynamically imports modules when you use the cmdlet

Discovering new commands

The real world of cmdlets

Questions or comments?

05 Object for the Admin Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview Object across the pipeline Getting the information you need Sorting Objects Selecting Objects Custom Properties Filtering data Methods When no cmdlet exists

Object across the pipeline

Getting the information you need Get-Member (gm) TypeName is a unique Windows assigned name Displays the properties and methods of an object Properties are potential columns of information Methods are the potential actions that can be taken

Sorting Objects Sort-Object sorts properties. Use Get-Member to see a list of properties

Selecting Objects Select-Object selects properties. Use Get-Member to list properties to select from. -first and -last restrict list of rows displayed.

Custom Properties

Filter Object Out of the Pipeline

Comparison Operators Comparison returns boolean True or False Comparison can be casesensitive using c prefix For complete description, see About_Comparison

Methods When no cmdlet exists

Questions or comments?

06 The Pipeline : Deeper Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview How the pipeline really works - The 4 step solution 1. ByValue 2. ByPropertyName 3. matchdoesn tpropertymyifwhat Customize it! 4. The Parenthetical when all else fails

How the pipeline really works - The 4 step solution

ByValue 1. Get-Service passes ServiceController objects to the pipeline 2. Does Stop-Service accept ServiceController Objects? 3. Help Stop-Service -Full displays a parameter that accepts ServiceController ByValue

ByPropertyName

ByPropertyName 1. Get-Process is passing a Process Object 2. Stop-Service does not support accepting Process objects ByValue, so PowerShell checks what can be accepted ByPropertyName. 3. -Name does accept strings ByPropertyName, and the objects in the pipeline are labeled as a Name property 4. Stop-Service attempts to use the objects for its - Name, in this example, fails

matchdoesn tpropertymyifwhat Customize it!

The Parenthetical when all else fails 1. I want to pass a list of computer names to Get- Service. Why does this fail? 2. -Name and -InputObject accept pipeline input ByValue, not - Computername. -Name accepts text, and then causes the failure. Parenthesis don t rely on binding and attach information directly to the desired

The Parenthetical when all else fails Returns a collection (table) of objects. Returns string contents

Questions or comments?

07 The Power in the Shell - Remoting Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview Overview of Remoting Enable Remoting One-To-One One-To-Many Not the end yet!

Overview of Remoting

Enable Remoting PowerShell Remoting is already enabled in Server 2012 Computer Configuration/Policies/Administrative Templates/Windows Components/Windows Remote Management

One to One - Interactive

One-To-Many

PowerShell Web Access PowerShell Anywhere, anytime, on any device! Install-WindowsFeature Name WindowsPowerShellWebAccess Get-Help *Pswa* Install-PswaWebApplication UseTestCertificate # Use the usetestcertificate for testing (Expires in 90 days) Add-PswaAuthorizationRule username <Domain\User Computer\user> -ComputerName <Computer> -ConfigurationName AdminsOnly

Not the end yet! More to come! Managing in scale and in real time! Automation and scripting! Great resource: Free! Secrets of PowerShell Remoting Don Jones and Tobias Weltner http://powershell.org/wp/powershell-books/

Questions or comments?

08 Getting prepared for automation Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview PowerShell security goals Execution Policy Variables : a place to store stuff Fun with Quotes Getting and displaying input Other output for scripts and automation

PowerShell security goals Secured by default Prevents mistakes by unintentional admins and users No Script Execution.Ps1 associated with notepad Must type path to execute a script

Execution Policy By default, PowerShell does not run scripts. Get/Set-ExecutionPolicy Restricted Unrestricted AllSigned RemoteSigned Bypass Undefined Can be set with Group Policy

Variables: A place to store stuff Use $ to create and use variables Can contain letters, numbers, spaces and underscores Don t persist after Shell exits New-Variable Set-Variable Get-Variable Clear-Variable Remove-Variable Can force a type [int]$var Note: The $ is not part of the variable name, it s a cue to access the contents of the variable

Fun with Quotes Double Quotes resolve all variables Can use Sub-Expressions Single Quotes prevent substitution Get-Help About_Quoting_Rules Back-tick/Grave-Accent prevents individual substitution

Getting and displaying input

Other output for scripts and automation Write-Warning Write-Verbose Write-Debug Write-Error $Preference variables to know Help about_preference_variables $DebugPreference=SilentlyContinue $ErrorActionPreference=Continue #VerbosePreference=SilentlyContinue

Questions or comments?

09 Automation in scale - Remoting Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview Reusable Sessions Sessions with Invoke-Command Real-world deployment of a website Getting commands from anywhere

Reusable Sessions Can be disconnected and reconnected in PowerShell V3

Sessions with Invoke-Command

Real-world deployment of a website Demonstration

Getting commands from anywhere - Implicit Remoting

Questions or comments?

10 Introducing scripting and toolmaking Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Module Overview The new ISE Making commands repeatable Adding parameters to your script Documenting your script Turning your script into a tool for others Storing your tools in a module

The new ISE

Making commands repeatable

Adding parameters to your script

Documenting your script

Turning your script into a tool for others

Storing your tools in a module

Questions or comments?

2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics 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.