1 / 44

WSV422

WSV422. Advanced Automation Using Windows PowerShell 3.0. Ian Lucas Principal Program Manager Microsoft Corporation. Chris Bellée Senior Premier Field Engineer Microsoft Corporation. Session Overview. Technical Level: 400 Intended Audience: IT administrators & scripters

analise
Télécharger la présentation

WSV422

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WSV422 Advanced Automation Using Windows PowerShell 3.0 Ian Lucas Principal Program Manager Microsoft Corporation Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  2. Session Overview • Technical Level: 400 • Intended Audience: IT administrators & scripters • Learning Objectives: • Learn about the improvements in Windows PowerShell 3.0 • Understand how to use advanced automation techniques • See how PowerShell features work in common scenarios

  3. Windows Server Management Philosophy In the past, Windows Server was a great operating system • for a singleserver • and its devices Windows Server 2012 is a great operating system • for manyservers • and the devices that connectthem • whether they are physicalor virtual • onpremises or offpremises

  4. Managing a Cloud-Optimized OS Automate Remote Agile PowerShell Standards Scale Robust

  5. Windows PowerShell 3.0 Themes Simple & Easy Comprehensive Coverage Robust & Scalable Rich Platform Standards-based v3.0 -gt v2.0

  6. Windows PowerShell 3.0 Features DEMO DEMO: Default Param Values DEMO DEMO: Disconnected Sessions DEMO DEMO: Module Autoloading DEMO DEMO: Member Enumeration DEMO: PowerShell Workflow DEMO DEMO DEMO: OData Endpoints DEMO: RunAs Support DEMO DEMO: Web Cmdlets DEMO DEMO: PS Web Access DEMO Updatable help system Method overload discovery HelpUri attribute support HelpFile property on FunctionInfo Simplified Where and ForEach Remoting local variables via $using Dynamic types & formats Get-Content -Tail Generic method invocation Typecasting deserialized objects New parser built on DLR Improved method overload selection New objects from hash tables Typecasting for parameter values Pipeline paging APIs Nested pipeline APIs $PSScriptRoot and $PSCommandPath Ordered hash tables Improved module discovery & import New module manifest keys Public abstract syntax tree Runspace pool cleanup API Public tab completion Windows RT API support Obsolete cmdlet attribute Command discovery improvements Script autosave support Out-GrideView -PassThru CIM cmdlet authoring from WMI v2 CIM .NET APIs Scheduled jobs Runtime script compilation Engine reliability improvements Better Get-ChildItem network perf Cmdlet definition files Certificate provider improvements Alternate NTFS data stream support Move-Item across drives Remote module discovery & import Remote session autodisconnect & retry Credentials for FileSystem provider Transport options for remote sessions Module logging Workflow persistence Job integration with Task Scheduler Alternate credential support for jobs Updated console font & branding Verb & noun on FunctionInfo Special character handling LiteralPath support for core cmdlets DLR-based tab completion Session configuration files IntelliSense support Windows Management Framework 3.0 WinPE support Windows RT support Windows PowerShell Web Access XAML-based workflows Script-based workflows Control Panel cmdlets Unblock-File cmdlet Workflow help Cmdlet to activity conversion RunAs and SharedHost support Improved WMI object formatting Heterogeneous object formatting Workflow logging Workflow extensibility Common workflow parameters Workflow execution environment Management OData IIS Extension Snippets ISE Add-ons $PSItem alias for $_ Show-Command Get-Help -ShowWindow Restart Manager support Web & REST cmdlets JSON cmdlets XML syntax highlighting Block select Collapsible regions Contextual F1 support Script Explorer DEMO DEMO DEMO DEMO: Session Config Files DEMO: Scheduled Jobs DEMO: File System Creds Windows PowerShell Workflow .NET Framework 4 support Add-Member improvements Computer cmdlets CSV handling improvements Get-ChildItem attributes Get-Command improvements Default Parameter Values Better history support Security cmdlet fixes Select-Object optimizations Select-String improvements Tee-Object -Append Disconnected sessions Idle timeout & server buffering control Invoke-Command in disconnected sessions Disconnected jobs STA mode by default Run with PowerShell context menu Module autoloading Console host start perf improvements ETW logging and tracing Core CIM cmdlets New Group Policy settings Output redirection for all streams Array member enumeration Word wrap in console host Default properties on custom objects DEMO DEMO: Ordered Hashtables DEMO DEMO: Method Overloads DEMO DEMO DEMO: Command Discovery DEMO: Parser Performance

  7. Windows PowerShell 3.0 Themes Robust & Scalable Comprehensive Coverage Simple & Easy v3.0 -gt v2.0 Rich Platform Standards-based

  8. Management CEC • CEC: Common Engineering Criteria • What: All Microsoft server products are required to comply with a set of engineering requirements as part of the CEC • Goal: Reduce the total cost of ownership through improved integration, manageability, security, reliability, and other critical infrastructure • Requirement: All management surfaces must be exposed via PowerShell cmdlets or providers • Result:COVERAGE

  9. Coverage Comparison • Windows Server 2008 R2 shipped with 587 commands • Windows Server 2008 R2 shipped with 12 modules • Windows Server 2012 shipped with 86 modules • Windows Server 2012 shipped with 2378 commands

  10. New Cmdlets in Windows PowerShell 3.0Thousands more in Windows Server 2012 Jobs • Add-JobTrigger • Disable-JobTrigger • Enable-JobTrigger • Get-JobTrigger • New-JobTrigger • Remove-JobTrigger • Set-JobTrigger • Disable-ScheduledJob • Enable-ScheduledJob • Get-ScheduledJob • Register-ScheduledJob • Set-ScheduledJob • Unregister-ScheduledJob • Get-ScheduledJobOption • New-ScheduledJobOption • Set-ScheduledJobOption CIM • Get-CimAssociatedInstance • Get-CimClass • Get-CimInstance • Get-CimSession • Invoke-CimMethod • New-CimInstance • New-CimSession • New-CimSessionOption • Register-CimIndicationEvent • Remove-CimInstance • Remove-CimSession • Set-CimInstance Remoting • Connect-PSSession • Disconnect-PSSession • Receive-PSSession • New-PSSessionConfigurationFile • Test-PSSessionConfigurationFile • New-PSTransportOption Workflow • New-PSWorkflowSession • New-PSWorkflowExecutionOption • Invoke-AsWorkflow • Resume-Job • Suspend-Job Web • ConvertFrom-Json • ConvertTo-Json • Invoke-RestMethod • Invoke-WebRequest Other • New-WinEvent • Unblock-File • Show-Command • Rename-Computer • Save-Help • Update-Help • Get-TypeData • Remove-TypeData • Get-ControlPanelItem • Show-ControlPanelItem

  11. Available Everywhere • Windows 8, Windows RT, & Windows Server 2012 Full Server • PowerShell Remoting enabled by default on Server SKUs • Server Core • With or without Server Graphical Shell or Graphical Management Tools • CIM modules remotable without PowerShell or .NET Framework installed • Windows Preinstallation Environment (WinPE) 4.0 • Windows Management Framework 3.0 • Windows Server 2008 / Windows 7 / Windows Server 2008 R2 (+Server Core) • Windows PowerShell Web Access • Access to PowerShell via web browser interface • Cross-platform support (IE, Firefox, Safari, Chrome)

  12. demo Coverage Ian Lucas Principal Program Manager Microsoft Corporation

  13. Windows PowerShell 3.0 Themes Comprehensive Coverage Robust & Scalable Simple & Easy v3.0 -gt v2.0 Rich Platform Standards-based

  14. Simple & Easy for New Users

  15. Simple & Easy for Existing Users • Ordered hash tables • New objects fromhash tables • Add-Member improvements • Default properties oncustom objects • Dynamic types & formats • Typecasting deserialized objects • Typecasting parameter values • Heterogeneous object formatting • Custom parametervalue defaults • Select-String improvements • Special character handling • LiteralPath support forcore cmdlets • XML syntax highlighting • Command + output insingle pane • Out-GridView -PassThru • Restart Manager support ETS Types & Formats Cmdlets ISE

  16. demo Simplified Language Simple & Easy Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  17. Windows PowerShell ISEIntegrated Scripting Environment • IntelliSense • Tab Completion API • Show-Command Pane • Module Autoloading • Regions & Outlining • Abstract Syntax Tree • F1 Help Window • Updatable Help System • Syntax Highlighting & Rich Copy • Abstract Syntax Tree IntelliSense

  18. Rich Platform Enables Script Sharing • TechNet Script Center • Script Repository • Script Explorer • ISE Add-ons Website • PowerShell Modules • PoshCode.org • PowerShellCommunity.org • PowerShell.com • PowerShellGroup.org

  19. demo ISE Enhancements Simple & Easy Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  20. Windows PowerShell 3.0 Themes Robust & Scalable Comprehensive Coverage Simple & Easy v3.0 -gt v2.0 Rich Platform Standards-based

  21. Scheduled Jobs • Job Scheduling allows you to schedule the execution of a PowerShell background job • Support for a rich set of triggers • Daily, weekly, or custom interval (day, week, month) • Once or with a specific repetition duration or interval • In response to a specific event such as log on or startup • Run under a different user account • PSScheduledJob module with 16 cmdlets • *-JobTrigger to create scheduled triggers • *-ScheduledJob to register, unregister, and change job definitions • *-ScheduledJobOption to configure advanced settings • *-Job to retrieve results any job type

  22. demo Scheduled Jobs Robust & Scalable Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  23. Robust Session Connectivity • Remote sessions remain in a "Connected" state during transient network glitches or failures for up to 4 minutes • After 4 minutes, remote sessions automatically transition to a new "Disconnected" state • Persistent commands and jobs can continue to run even if the session is disconnected • Client can reconnect to a disconnected session after network connectivity with the server has been restored • Cmdlets for managing disconnected sessions

  24. demo Disconnected Sessions Robust & Scalable Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  25. Windows PowerShell Workflow • WHAT: Multi-machine orchestration engine built on Windows Workflow Foundation and .NET 4.0 • WHY: Reliably execute long-running management tasks across multiple machines or IT processes • HOW: • Robust: Suspend & resume workflows, survive machine interruptions • Scalable: Parallel task execution, common multi-machine parameters • Reliable: Automatic connection and action retry with configurable intervals • Performance: Connection pooling, workflow throttling, shared hosting • Familiar: Author workflows as PS scripts or XAML, manage via *-Job cmdlets

  26. Workflow Demo Setup SAME • Management Server • Runs PowerShell Workflow • Accepts incoming connections from admin clients • Targets workflows at multiple managed nodes • Managed Nodes • Machines targeted by workflows • Admin Client • Where IT pro does their work • Connects to Management Server

  27. demo PowerShell Workflow Robust & Scalable Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  28. Windows PowerShell 3.0 Themes Simple & Easy Comprehensive Coverage Robust & Scalable Standards-based v3.0 -gt v2.0 Rich Platform

  29. Windows PowerShell Web Access • Provides access to Windows PowerShell from anywhere • Increases the value of your investment in PowerShell • Write cmdlets, get web-based management for free • Built for tablets and mobile devices as well as PCs • Cross-platform support: IE, Firefox, Safari, Chrome Internet Access Corporate network Windows PowerShell Web Access Client

  30. Windows PowerShell Web Access Security Client Certificate Authentication Forms-based Gateway Authentication WPWA Authorization Rules Target Authorization & Authorization Rules Target Defence In Depth

  31. demo PowerShell Web Access Rich Platform Ian Lucas Principal Program Manager Microsoft Corporation

  32. Simple & Easy Delegated Administration • Session Configuration Files • Easy remote endpoint creation • Uses PowerShell data files • Declarative name-value pairs • No scripting required • RunAs • New settings within WSMan plug-in • RunAsUser & RunAsPassword • Allows running remote sessions with different creds • SharedHost • Normally each session runs in a separate process • Allows multiple remote sessions to run in same process

  33. demo Delegated Administration Rich Platform Ian Lucas Principal Program Manager Microsoft Corporation

  34. Windows PowerShell 3.0 Themes Simple & Easy Comprehensive Coverage Robust & Scalable Rich Platform v3.0 -gt v2.0 Standards-based

  35. Standards-based Management • Provides management interoperability with standard interfaces and protocols • DMTF standards • Interface => Common Information Model (CIM) • Defines a consistent way to manage everything in the datacenter • WMI v2: Access to CIM over WSMan • PowerShell cmdlets automatically generated from WMI v2 providers • Protocol => Web Services for Management (WSMan) • Provides web services access to CIM on heterogeneous devices • WinRM: Microsoft implementation of the WSMan protocol • Microsoft extensions to WSMan enable PowerShell remoting

  36. Management OData IIS Extension • Open Data Protocol (OData): RESTful web protocol based on HTTP and JSON for querying and updating data • Management OData IIS Extension: Infrastructure to create web service endpoints for remote management via OData • Enables management of Windows Server from heterogeneous clients: Windows, non-Windows, mobile, JavaScript, PHP, Perl, .NET, etc. • Accepts incoming OData requests, maps requests to PowerShell cmdlets, invokes the cmdlets, and returns output to the client • Ships with WS2012 and WMF 3.0, samples in Windows SDK • Schema Designer:Graphical tool to create authorization DLLs and schema files needed to deploy a Management OData endpoint

  37. Management OData Demo Setup SAME • Management Server • Runs Management OData IIS Extension • Managed Nodes • Machines targeted by management operations • Admin Client • Where IT pro does their work • Connects to Management Server

  38. demo Management OData IIS Extension Standards-based Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  39. Windows PowerShell 3.0 Themes Simple & Easy Comprehensive Coverage Robust & Scalable Rich Platform v3.0 -gt v2.0 Standards-based

  40. New & Improved in Windows PowerShell 3.0 • PowerShell Workflow • Windows PowerShell Web Access • ISE enhancements • WinPE and Windows RT support • Disconnected sessions • Robust session connectivity • Updatable help system • CIM cmdlets • Session configuration files • Scheduled jobs • Language enhancements • New core cmdlets • Remote module import and discovery • New tab completion with IntelliSense • Module experience improvements • Simplified command discovery • Better logging and diagnostics • Improved core cmdlets and providers • Format and output improvements • Enhanced console host experience • New cmdlet and hosting APIs • Performance improvements • RunAs and Shared Host support • Special character handling Products of true enduring quality are not those that do 1 thing 1,000% better but those that do 1,000s of things 1% better

  41. Top Votes on ConnectOver 250 feedback items addressed • Capture Warning, Verbose, Debug and Host Output via alternate streams • Add enumeration parameter to Get-ChildItem cmdlet to specify Container/Non-container/Both • dir -ad and other Get-ChildItem improvements • Make it easier to create custom objects • Ordered hashes as an option • Modules: Unable to determine script module filename at load time (there should be a $psmoduleinfo) • Get-Command and Get-Help should display the ModuleName • MVP: Get-Module output should sort by name by default • PSV2: Lazy pipeline - ability for cmdlets to say "NO MORE" • Add auto-variable $PSScriptRoot • Script Logging needs to be improved • Import-Csv should have -Encoding parameter • add an -Append Switch to Export-CSV • Tee-Object Needs -Append parameter • Add "sst" alias for Select-String cmdlet • Bug with Default Formatter • *-item cmdlets ignore items containing "[]" • Square Bracket "Range" globbing is a bug not a feature • Can’t redirect all the output pipelines • Get-ACL (and some other cmdlets) need support for the LiteralPath parameter • Get-Command doesn't show function if 2 modules are loaded that have same function name • Get-Command doesn't display information about duplicate commands • Foreach should not execute the loop body for a scalar value of $null • Default properties on custom objects • Select-Object optimization • Set-AuthenticodeSignature fails on scripts created from ISE • Multiple ambiguous overloads

  42. demo v3.0 -gt v2.0 v3.0 -gt v2.0 Chris Bellée Senior Premier Field Engineer Microsoft Corporation

  43. Call to Action • Windows PowerShell 3.0 provides a comprehensive, resilient, and simple way to automate the management of servers in your network • Pick up the RTM bits today • Windows 8 and Windows Server 2012 RTM • Windows Management Framework 3.0 RTM for Windows7/2008/2008R2 • http://www.microsoft.com/en-us/download/details.aspx?id=34595 Join-In | Send-Feedback | Invoke-Fun

  44. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.

More Related