Wsv406 Advanced Automation Using Windows Power Shell2.0


Published on

Atlanta TechEd 2011 talk

Published in: Technology, Business
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Wsv406 Advanced Automation Using Windows Power Shell2.0

  1. 1.
  2. 2. Advanced Automation UsingWindows PowerShell 2.0<br />WSV406<br />Jeffrey Snover<br />Distinguished Engineer<br />Microsoft<br />Dan Harman<br />Senior Program Manager<br />Microsoft<br />
  3. 3. Session Overview<br />Technical Level: 400<br />Intended Audience: IT administrators and scripters<br />Learning Objectives:<br />Learn about improvements to Windows PowerShell 2.0<br />Understand how to use advanced scripting techniques<br />See how PowerShell features work in common scenarios<br />Presentation Outline:<br />Overview of new PowerShell 2.0 features<br />Advanced scripting techniques in depth<br />GUI over PowerShell demo<br />Production scripting demo<br />Universal automation environment demo<br />
  4. 4. Improvements in PowerShell 2.0Dozens of big features<br />Remoting<br />PowerShell ISE<br />Advanced Functions<br />Background Jobs<br />Restricted Sessions<br />Transactions<br />Out-GridView<br />Script Debugging<br />New & Improved Cmdlets<br />Hosting APIs<br />Modules<br />Eventing<br />Session Pools<br />Language Enhancements<br />WMI Improvements<br />Improved AD Adapter<br />Performance Improvements<br />Script Internationalization<br />Parser API Support<br />More…<br />
  5. 5. PowerShell Architecture<br />
  6. 6. PowerShell 2.0 Themes<br />Production Scripting<br />Universal Automation Environment<br />GUI over PowerShell<br />Language and Cmdlets<br />
  7. 7. GUI Over PowerShell<br />Layering admin GUIs on top of PowerShell<br />Drives consistency between CLI & GUI<br />Enables agility in delivering new GUIs<br />Guarantees automation of GUI commands<br />Facilitates GUI teaching command line<br />Standardizes access to managed elements<br />GUI over PowerShell<br />
  8. 8. GUI Over PowerShell Features<br />PowerShell ISE<br />Out-GridView<br />Hosting APIs<br />Session Pooling<br />Thread Control<br />
  9. 9. demo<br />GUI Over PowerShell<br />Dan Harman<br />Senior Program Manager<br />Windows PowerShell<br />
  10. 10. Production Scripting<br />Production Scripting<br />Scripts are:<br />Easy to use<br />Easy to share<br />Easy to support<br />Safe to operate<br />
  11. 11. Production Scripting Features<br />Advanced Functions<br />Advanced Functions<br />Native Code<br />Debugger Enhancements<br />Restricted Language<br />Modules<br />Transactions<br />
  12. 12. Advanced Functions<br />Gives the power of authoring custom cmdlets to IT pros<br />Write PowerShell cmdlets using script instead of compiled code<br />Enables consistent syntax and semantics between functions & cmdlets<br />Evolution of function syntax from PowerShell 1.0<br />Near parity with .NET cmdlet capabilities<br />Parameter attributes<br />Range<br />Length<br />Not Null<br />Not Null or Empty<br />Pattern<br />Set<br />Count<br />Script<br />Cmdlet attributes<br />-SupportsShouldProcess<br />-ConfirmImpact { Low | Medium | High }<br />$PSCmdlet similar to 'this' in C#<br />$PSCmdlet.ShouldProcess("Target", "Action")<br />$PSCmdlet.ShouldContinue("Query", "Caption")<br />Support inline help or external PSMAML help<br />
  13. 13. demo<br />Production ScriptingAdvanced Functions<br />Jeffrey Snover<br />Distinguished Engineer<br />Windows PowerShell<br />
  14. 14. demo<br />Production ScriptingModules<br />Dan Harman<br />Senior Program Manager<br />Windows PowerShell<br />
  15. 15. Universal Automation Environment<br />Interactive or programmatic<br />In the foreground or background<br />Local or remote<br />Single machine or multiple machines<br />Synchronous or asynchronous<br />In restricted or unrestricted environments<br />Wide range of authentication mechanisms<br />Simple scripting to systems programming<br />Universal Automation Environment<br />
  16. 16. Automation Environment Features<br />Remoting<br />Background Jobs<br />Eventing<br />Restricted Sessions<br />Mobile Object Model<br />
  17. 17. Remoting Scenarios<br />1:Many (fan-out): Large Scale Automation<br />Send the script to remote machines<br />Select properties - allows client to specify which properties to return<br />Throttling - limits the number of concurrent operations<br />Job support - runs commands in the background on client<br />1:1 (interactive): Secure Telnet Replacement<br />Cmdlet equivalent of Remote Desktop<br />Interact with a remote machine as if it were local<br />No Invoke-Command required<br />Ideal for troubleshooting a remote machine<br />Many:1 (fan-in): Delegated Administration & Hosting<br />Hosting model for web services<br />No tools installation required on client<br />Constrained session environment (cmdlets, parameters, language)<br />
  18. 18. demo<br />Universal Automation EnvironmentRemoting<br />Jeffrey Snover<br />Distinguished Engineer<br />Windows PowerShell<br />
  19. 19. demo<br />Universal Automation EnvironmentBackground Jobs<br />Dan Harman<br />Senior Program Manager<br />Windows PowerShell<br />
  20. 20. Language and Cmdlets<br />Responding to community feedback<br />Enhance the language<br />Improve the engine<br />Provide more built-in cmdlets<br />Language and Cmdlets<br />
  21. 21. Language and Cmdlets<br />New Cmdlets<br />WMI++<br />Language<br />Enhancements<br />Improved<br />Object Adapters<br />
  22. 22. Over 100 New Built-In CmdletsHundreds more from partners<br />Modules<br />Export-ModuleMember<br />Get-Module<br />Import-Module<br />New-Module<br />New-ModuleManifest<br />Remove-Module<br />Test-ModuleManifest<br />Eventing<br />Get-Event<br />Get-EventSubscriber<br />New-Event<br />Register-EngineEvent<br />Register-ObjectEvent<br />Remove-Event<br />Unregister-Event<br />Wait-Event<br />WS-Man<br />Connect-WSMan<br />Disable-WSManCredSSP<br />Disconnect-WSMan<br />Enable-WSManCredSSP<br />Get-WSManCredSSP<br />Get-WSManInstance<br />Invoke-WSManAction<br />New-WSManInstance<br />New-WSManSessionOption<br />Remove-WSManInstance<br />Set-WSManInstance<br />Set-WSManQuickConfig<br />Test-WSMan<br />Transactions<br />Complete-Transaction<br />Get-Transaction<br />Start-Transaction<br />Undo-Transaction<br />Use-Transaction<br />Debugging<br />Disable-PSBreakpoint<br />Enable-PSBreakpoint<br />Get-PSBreakpoint<br />Get-PSCallStack<br />Remove-PSBreakpoint<br />Set-PSBreakpoint<br />Type Conversion<br />Add-Type<br />ConvertFrom-Csv<br />ConvertFrom-StringData<br />ConvertTo-Csv<br />ConvertTo-Xml<br />Diagnostics<br />Clear-EventLog<br />Export-Counter<br />Get-Counter<br />Get-Hotfix<br />Get-WinEvent<br />Import-Counter<br />Limit-EventLog<br />New-EventLog<br />Remove-EventLog<br />Show-EventLog<br />Write-EventLog<br />Computers<br />Add-Computer<br />Checkpoint-Computer<br />Disable-ComputerRestore<br />Enable-ComputerRestore<br />Get-ComputerRestorePoint<br />Remove-Computer<br />Reset-ComputerPassword<br />Restart-Computer<br />Restore-Computer<br />Stop-Computer<br />Test-Connection<br />WMI<br />Invoke-WMIMethod<br />Register-WMIEvent<br />Remove-WMIObject<br />Set-WMIInstance<br />Other<br />Clear-History<br />Debug-Process<br />Export-FormatData<br />Get-FormatData<br />Get-Random<br />Import-LocalizedData<br />Out-GridView<br />Select-Xml<br />Send-MailMessage<br />Set-StrictMode<br />Start-Process<br />Test-ComputerSecureChannel<br />Update-List<br />Wait-Process<br />Remoting<br />Disable-PSSessionConfiguration<br />Enable-PSSessionConfiguration<br />Enable-PSRemoting<br />Enter-PSSession<br />Exit-PSSession<br />Export-PSSession<br />Get-PSSession<br />Get-PSSessionConfiguration<br />Import-PSSession<br />Invoke-Command<br />New-PSSession<br />New-PSSessionOption<br />New-WebServiceProxy<br />Register-PSSessionConfiguration<br />Remove-PSSession<br />Set-PSSessionConfiguration<br />Custom Sessions<br />Disable-PSSessionConfiguration<br />Enable-PSSessionConfiguration<br />Get-PSSessionConfiguration<br />New-PSSessionOption<br />Register-PSSessionConfiguration<br />Set-PSSessionConfiguration<br />Unregister-PSSessionConfiguration<br />Background Jobs<br />Get-Job<br />Receive-Job<br />Remove-Job<br />Start-Job<br />Stop-Job<br />Wait-Job<br />
  23. 23. 16 New Partners in Windows 7 & WS08 R2Many active internal partners<br />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<br />
  24. 24. Windows PowerShell Community Resources<br />Team blog:<br />PowerShell Community:<br />PowerShell Forum:<br />Channel 9:<br />Wiki:<br />Script Center:<br />CodePlex:<br />Some good books<br />PowerShell in Action, 2nd Edition by Bruce Payette<br /><br />Windows PowerShell Cookbook, 2nd Edition by Lee Holmes<br />Professional Windows PowerShell Programming<br />PowerShell Comics!<br />
  25. 25. Related Content<br />Breakout Sessions<br />WSV406 | Advanced Automation Using Windows PowerShell 2.0 <br />WSV315 Windows PowerShell for Beginners <br />WCL321 | Windows PowerShell Remoting: Definitely NOT Just for Servers <br />WSV322 | Managing the Registry with Windows PowerShell 2.0<br />WSV471-INT | Build Reusable Tools in Windows PowerShell<br />WSV473-INT | Windows PowerShell 3.0: Why Wait? Get Next-Generation PowerShell…<br />EXL321 | Microsoft Lync Server 2010: Administering Lync Server Deployment<br />Hands-on Labs<br />WSV276-HOL Introduction to Windows PowerShell Fundamentals <br />WSV371-HOL Advanced Windows PowerShell Scripting <br />WSV378-HOL Server Management and Windows PowerShell V2 <br />Product Demo Stations <br />WSV 1 – Windows PowerShell and Server Management<br />
  26. 26. Track Resources<br />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.<br />You can also find the latest information about our products at the following links:<br />Cloud Power -<br />Private Cloud -<br />Windows Server -<br />Windows Azure -<br />Microsoft System Center -<br />Microsoft Forefront -<br />
  27. 27. Resources<br />Connect. Share. Discuss.<br /><br />Learning<br />Sessions On-Demand & Community<br />Microsoft Certification & Training Resources<br /><br /><br />Resources for IT Professionals<br />Resources for Developers<br /><br /><br />
  28. 28. Complete an evaluation on CommNet and enter to win!<br />
  29. 29.
  30. 30. © 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.<br />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.<br />