good morning and thank you!. have some fun! learn at least one thing new! make myself available...

13
Good Morning and Thank You!

Upload: bartholomew-stokes

Post on 02-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 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!

Good Morningand

Thank You!

Page 2: 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!

POWERSHELL NOT YOUR FATHER'S COMMAND LINE

10 THINGS YOU NEED TO KNOW

Page 3: 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!

MY PROMISES TO YOU…

Have some Fun! Learn at least one thing new! Make myself available to you

So please … Ask questions and enjoy!

Page 4: 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!

Presented by:

Matthew HesterIT Pro EvangelistMicrosoft Corporation

[email protected]@matthewhesterhttp://blogs.technet.com/matthewms

My Boss Martin [email protected]

Microsoft Windows Server 2008 R2Administration Instant Reference

Page 5: 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!

WHAT IS POWERSHELL?

Rich script environme

nt

Bulk Operations

Interactive Shell

Task Automatio

n

Object Oriented

Page 6: 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!

WHEN TO USE

Use PowerShell for consistent, repeatable tasks Built-in providers

Talk to Active Directory, registry, WMI, etc. natively Aliases

Bridge the gap for previous languages Tab complete

If it's a good script I'll do it. And if it's a bad script, and they pay me enough, I'll do it.

George Burns

Page 7: 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!

WINDOWS POWERSHELL SYNTAX

Status Name DisplayName------ ---- ----------- Stopped NetLogon NetLogonRunning Netman Network Connections

PS> get-service –name “*net*”

Verb NounName

ArgumentString

Command Parameter

Property Names

Property Values

CAsE InSeNsitIve!*

Page 8: 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!

HOW TO FIND HELP

Page 9: 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!

POWER OF THE PIPE

The Pipe Operator “|” Output from one command becomes input

for the next String together multiple commands

Parameter binding is the key “|” routes information to the correct

parameters – with very little effort

Page 10: 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!

COMMON CMDLETS

Get-HelpGet-Help Get-Process

Get-CommandExample

Get-MemberGet-Service | Get-Member

Restart-ServiceRestart-Service IISADMIN

FormatGet-Service | Format-List

SortingGet-Process | Sort-Object -Property CPU

Redirecting OutputGet-Service | Out-File –FilePath C:\temp\services.txt

Productive cmdlets Utility cmdlets

Page 11: 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!

SECURITY AND WINDOWS POWERSHELL

Policy Effects

Restricted No scripts

AllSigned All scripts must be signed

RemoteSigned Local scripts, remote signed

Unrestricted Nothing signed

Default Execution Policy Is Restricted

Execution Policy Can Be Modified• Set-ExecutionPolicy• Group Policy

Page 12: 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!

REMOTING WITH POWERSHELL

Introduced in v2 Utilizes WinRM (Windows Remote

Management), based on WS-MAN (Web Services for Management)

A PSSession is a persistent connection Interact with sessions 1:1

Page 13: 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!

PROVIDERS

Abstraction of data Provides consistent access (resembles

a file system) Discoverability: Get-PSProvider Write a custom provider