1 / 30

Advanced Automation Using Windows PowerShell 2.0

WSV406. Advanced Automation Using Windows PowerShell 2.0. Jeffrey Snover Distinguished Engineer Microsoft. Dan Harman Senior Program Manager Microsoft. Session Overview. Technical Level: 400 Intended Audience: IT administrators and scripters Learning Objectives:

amiel
Download Presentation

Advanced Automation Using Windows PowerShell 2.0

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. WSV406 Advanced Automation UsingWindows PowerShell 2.0 Jeffrey Snover Distinguished Engineer Microsoft Dan Harman Senior Program Manager Microsoft

  2. Session Overview • Technical Level: 400 • Intended Audience: IT administrators and scripters • Learning Objectives: • Learn about improvements to Windows PowerShell 2.0 • Understand how to use advanced scripting techniques • See how PowerShell features work in common scenarios • Presentation Outline: • Overview of new PowerShell 2.0 features • Advanced scripting techniques in depth • GUI over PowerShell demo • Production scripting demo • Universal automation environment demo

  3. Improvements in PowerShell 2.0Dozens of big features • Remoting • PowerShell ISE • Advanced Functions • Background Jobs • Restricted Sessions • Transactions • Out-GridView • Script Debugging • New & Improved Cmdlets • Hosting APIs • Modules • Eventing • Session Pools • Language Enhancements • WMI Improvements • Improved AD Adapter • Performance Improvements • Script Internationalization • Parser API Support • More…

  4. PowerShell Architecture

  5. PowerShell 2.0 Themes Production Scripting Universal Automation Environment GUI over PowerShell Language and Cmdlets

  6. GUI Over PowerShell • Layering admin GUIs on top of PowerShell • Drives consistency between CLI & GUI • Enables agility in delivering new GUIs • Guarantees automation of GUI commands • Facilitates GUI teaching command line • Standardizes access to managed elements GUI over PowerShell

  7. GUI Over PowerShell Features PowerShell ISE Out-GridView Hosting APIs Session Pooling Thread Control

  8. GUI Over PowerShell Dan Harman Senior Program Manager Windows PowerShell demo

  9. Production Scripting Production Scripting • Scripts are: • Easy to use • Easy to share • Easy to support • Safe to operate

  10. Production Scripting Features Advanced Functions Advanced Functions Native Code Debugger Enhancements Restricted Language Modules Transactions

  11. Advanced Functions • Gives the power of authoring custom cmdlets to IT pros • Write PowerShell cmdlets using script instead of compiled code • Enables consistent syntax and semantics between functions & cmdlets • Evolution of function syntax from PowerShell 1.0 • Near parity with .NET cmdlet capabilities • Parameter attributes • Range • Length • Not Null • Not Null or Empty • Pattern • Set • Count • Script • Cmdlet attributes • -SupportsShouldProcess • -ConfirmImpact { Low | Medium | High } • $PSCmdlet similar to 'this' in C# • $PSCmdlet.ShouldProcess("Target", "Action") • $PSCmdlet.ShouldContinue("Query", "Caption") • Support inline help or external PSMAML help

  12. Production ScriptingAdvanced Functions Jeffrey Snover Distinguished Engineer Windows PowerShell demo

  13. Production ScriptingModules Dan Harman Senior Program Manager Windows PowerShell demo

  14. Universal Automation Environment • Interactive or programmatic • In the foreground or background • Local or remote • Single machine or multiple machines • Synchronous or asynchronous • In restricted or unrestricted environments • Wide range of authentication mechanisms • Simple scripting to systems programming Universal Automation Environment

  15. Automation Environment Features Remoting Background Jobs Eventing Restricted Sessions Mobile Object Model

  16. Remoting Scenarios • 1:Many (fan-out): Large Scale Automation • Send the script to remote machines • Select properties - allows client to specify which properties to return • Throttling - limits the number of concurrent operations • Job support - runs commands in the background on client • 1:1 (interactive): Secure Telnet Replacement • Cmdlet equivalent of Remote Desktop • Interact with a remote machine as if it were local • No Invoke-Command required • Ideal for troubleshooting a remote machine • Many:1 (fan-in): Delegated Administration & Hosting • Hosting model for web services • No tools installation required on client • Constrained session environment (cmdlets, parameters, language)

  17. Universal Automation EnvironmentRemoting Jeffrey Snover Distinguished Engineer Windows PowerShell demo

  18. Universal Automation EnvironmentBackground Jobs Dan Harman Senior Program Manager Windows PowerShell demo

  19. Language and Cmdlets • Responding to community feedback • Enhance the language • Improve the engine • Provide more built-in cmdlets Language and Cmdlets

  20. Language and Cmdlets New Cmdlets WMI++ Language Enhancements Improved Object Adapters

  21. Over 100 New Built-In CmdletsHundreds more from partners Remoting • Disable-PSSessionConfiguration • Enable-PSSessionConfiguration • Enable-PSRemoting • Enter-PSSession • Exit-PSSession • Export-PSSession • Get-PSSession • Get-PSSessionConfiguration • Import-PSSession • Invoke-Command • New-PSSession • New-PSSessionOption • New-WebServiceProxy • Register-PSSessionConfiguration • Remove-PSSession • Set-PSSessionConfiguration Custom Sessions • Disable-PSSessionConfiguration • Enable-PSSessionConfiguration • Get-PSSessionConfiguration • New-PSSessionOption • Register-PSSessionConfiguration • Set-PSSessionConfiguration • Unregister-PSSessionConfiguration Background Jobs • Get-Job • Receive-Job • Remove-Job • Start-Job • Stop-Job • Wait-Job Modules • Export-ModuleMember • Get-Module • Import-Module • New-Module • New-ModuleManifest • Remove-Module • Test-ModuleManifest Eventing • Get-Event • Get-EventSubscriber • New-Event • Register-EngineEvent • Register-ObjectEvent • Remove-Event • Unregister-Event • Wait-Event WS-Man • Connect-WSMan • Disable-WSManCredSSP • Disconnect-WSMan • Enable-WSManCredSSP • Get-WSManCredSSP • Get-WSManInstance • Invoke-WSManAction • New-WSManInstance • New-WSManSessionOption • Remove-WSManInstance • Set-WSManInstance • Set-WSManQuickConfig • Test-WSMan Transactions • Complete-Transaction • Get-Transaction • Start-Transaction • Undo-Transaction • Use-Transaction Debugging • Disable-PSBreakpoint • Enable-PSBreakpoint • Get-PSBreakpoint • Get-PSCallStack • Remove-PSBreakpoint • Set-PSBreakpoint Type Conversion • Add-Type • ConvertFrom-Csv • ConvertFrom-StringData • ConvertTo-Csv • ConvertTo-Xml Diagnostics • Clear-EventLog • Export-Counter • Get-Counter • Get-Hotfix • Get-WinEvent • Import-Counter • Limit-EventLog • New-EventLog • Remove-EventLog • Show-EventLog • Write-EventLog Computers • Add-Computer • Checkpoint-Computer • Disable-ComputerRestore • Enable-ComputerRestore • Get-ComputerRestorePoint • Remove-Computer • Reset-ComputerPassword • Restart-Computer • Restore-Computer • Stop-Computer • Test-Connection WMI • Invoke-WMIMethod • Register-WMIEvent • Remove-WMIObject • Set-WMIInstance Other • Clear-History • Debug-Process • Export-FormatData • Get-FormatData • Get-Random • Import-LocalizedData • Out-GridView • Select-Xml • Send-MailMessage • Set-StrictMode • Start-Process • Test-ComputerSecureChannel • Update-List • Wait-Process

  22. 16 New Partners in Windows 7 & WS08 R2Many active internal partners Exchange Server • Windows Diagnostics • Server Manager • SQL Server • Active Directory • Failover Clustering • System Center Operations Manager • Windows Backup • Server Migration • System Center Virtual Machine Manager • Best Practices Analyzer • Active Directory Rights Management Services • Internet Information Services • Background Intelligent Transfer Service • System Center Data Protection Manager • Network Load Balancing • Remote Desktop Services • Group Policy • WS-Management • AppLocker • WMI

  23. Windows PowerShell Community Resources • Team blog: http://blogs.msdn.com/PowerShell • PowerShell Community: http://www.powershellcommunity.org • PowerShell Forum: http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/threads • Channel 9: http://channel9.msdn.com/tags/PowerShell • Wiki: http://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki • Script Center: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx • CodePlex: http://codeplex.com/Project/ProjectDirectory.aspx?TagName=powershell • Some good books • PowerShell in Action, 2nd Edition by Bruce Payette http://www.manning.com/payette2 • Windows PowerShell Cookbook, 2nd Edition by Lee Holmes http://oreilly.com/catalog/9780596801519/ • Professional Windows PowerShell Programming http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470173939.html • PowerShell Comics! http://borntolearn.mslearn.net/comics/b/weblog/archive/2011/04/20/climbing-mt-powershell-comic-book-first-pages.aspx

  24. Related Content • Breakout Sessions • WSV406 | Advanced Automation Using Windows PowerShell 2.0 • WSV315 Windows PowerShell for Beginners • WCL321 | Windows PowerShell Remoting: Definitely NOT Just for Servers • WSV322 | Managing the Registry with Windows PowerShell 2.0 • WSV471-INT | Build Reusable Tools in Windows PowerShell • WSV473-INT | Windows PowerShell 3.0: Why Wait? Get Next-Generation PowerShell… • EXL321 | Microsoft Lync Server 2010: Administering Lync Server Deployment • Hands-on Labs • WSV276-HOL Introduction to Windows PowerShell Fundamentals • WSV371-HOL Advanced Windows PowerShell Scripting • WSV378-HOL Server Management and Windows PowerShell V2 • Product Demo Stations • WSV 1 – Windows PowerShell and Server Management

  25. Track Resources Don’t forget to visit the Cloud Power area within the TLC (Blue Section) to see product demos and speak with experts about the Server & Cloud Platform solutions that help drive your business forward. You can also find the latest information about our products at the following links: • Cloud Power - http://www.microsoft.com/cloud/ • Private Cloud - http://www.microsoft.com/privatecloud/ • Windows Server - http://www.microsoft.com/windowsserver/ • Windows Azure - http://www.microsoft.com/windowsazure/ • Microsoft System Center - http://www.microsoft.com/systemcenter/ • Microsoft Forefront - http://www.microsoft.com/forefront/

  26. Resources • Connect. Share. Discuss. http://northamerica.msteched.com Learning • Sessions On-Demand & Community • Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers http://microsoft.com/technet http://microsoft.com/msdn

  27. Complete an evaluation on CommNet and enter to win!

  28. © 2011 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