MGT305 Windows PowerShell Next Generation Command Line Scripting Jeffrey Snover & Leonard Chung Windows Enterprise Management Division.

Slides:



Advertisements
Similar presentations
Windows PowerShell Crash Course Don Jones Concentrated Technology Jeffrey Snover Microsoft WSV321.
Advertisements

Jeffrey Snover Partner Architect Microsoft Corporation ES24.
Designing InfoPath Forms: The Dos and Donts Deploying InfoPath Forms: Making the right choice Adding custom business logicin case the built-in stuff isnt.
Faith Allington Program Manager Microsoft Corporation WSV322.
Jeffrey Snover | Distinguished Engineer & Lead Architect Jason Helmick | Senior Technologist, Concentrated Technology.
Microsoft PowerShell Tom Roeder CS fa. Motivation.NET as a platform shell web server database access Native access to resources eaiser to manage.
© 2010 Quest Software, Inc. ALL RIGHTS RESERVED Techstravaganza 2010 PowerShell AD commandlets Barry Gerdsen Solutions Architect - Quest Software
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Windows Server “Longhorn” RDP Airlift. Managing AD with PowerShell; Creating custom administrative consoles Dmitry Sotnikov CTO, Windows Management Quest.
James Boother Blog: INTRODUCTION TO POWERSHELL.
More Control and Flexibility Vitalis Konopelec Technology Solution Professional Microsoft Slovakia s.r.o.
Kalpesh Patel Ramprabhu Rathnam
Monad: Microsoft’s Next Generation Command Shell Thomas Lee Chief Technologist QA plc.
Daniel Petri MVP, Microsoft Infrastructure Manager John Bryce Training November 2007.
Tech·Ed North America /19/2017 7:21 AM
 Jeffrey Snover Partner Architect Microsoft Corporation.
PowerShell: Drink the Kool-Aid!. Who we are…..Who we are…..
Windows Vista: Volume Activation 2.0
Matt Ayers Senior Program Manager Microsoft Corporation WCL403.
1 Monad – A New Command Shell Jeffrey Snover, Architect James Truher, Program Manager TLN303 Microsoft Corporation.
© 2007 Asynchrony Solutions, Inc. 1 10/29/07 Introduction to PowerShell Brian Button VP Engineering Asynchrony Solutions, Inc
Managing Citrix Farms Using MFCOM and Powershell.
Datacenter X Datacenter Y ….com Contoso.com Exchange Labs ACME.com Ops NK App user Finance HR Sales Purchase Fabrikam Enterprises.
PowerShell Basics. o PowerShell is a great way to manipulate server and/or workstation components o It’s geared toward system administrators by creating.
ADM 331 Administrative Scripting for IIS 6.0 Using WMI Alexis Eller Program Manager Internet Information Services (IIS)
Exploiting New Capabilities for Search And Organization Kerem Karatal DAT307 Lead Program Manager Microsoft Corporation.
OFC335 Microsoft Office Word 2007 XML Programmability: True Data/View Separation and Rich Eventing for Custom XML Tristan Davis Program Manager Microsoft.
Powershell Scripting on Vista and XP in AD. Examples (on local and remote PC’s) Show COM,ADSI,.NET, WMI techniques List drives List Software installed.
DEP362 Automated Deployment Services Paul Sutton Program Manager.
OFC290 Information Rights Management in Microsoft Office 2003 Lauren Antonoff Group Program Manager.
Section 6: Using Windows PowerShell to Manage Group Policy Introducing Windows PowerShell Windows PowerShell Library for Group Policy Windows PowerShell-Based.
December, 21, 2010 Bartek Bielawski Sr IT Site Services Specialist Warsaw, Poland.
PowerShell for Dummies Kurt Callemin. WHO AM I ? Kurt Callemin Final year student at KHBO: Master of Science Electronics- ICT Microsoft Student Partner.
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!
Chinmay Gokhale SE | Microsoft
Advanced ETL: Embedding Integration Services Ashvini Sharma Development Lead DAT411 Microsoft Corporation Sergei Ivanov Technical Lead DAT411 Microsoft.
Managing Windows Servers with PowerShell V2 James O’Neill: Evangelist, Microsoft UK Richard Siddaway MVP.
“ WinFS” Future Directions: Building Data-Centric Applications Using Windows Presentation Foundation “Avalon” and Windows Forms Ramesh Nagarajan DAT310.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
Simplify IT Management with AD Scripting Chalermrath K. (MCSE: Security) Jirat B. (MCSE, RHCE) Technology Specialists Microsoft Thailand.
Everything You Want To Know About Script But Were Afraid To Ask… Mark Carroll Drew Lytle Script Technologies Microsoft Corporation.
Windows PowerShell Introduction 1 Morgan Simonsen Ementor.
PowerShell for IT Administrators Richard Siddaway Perot Systems.
MSG331 Exchange Server 2000/2003 Software Development Kit Susan Hill Lead Programmer Writer Microsoft Corporation.
1 Sneak Preview to Windows Key Areas of Focus of Windows 2008 Improvements in Server Security New Terminal Services capabilities Network Access.
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Windows PowerShell. What is Windows PowerShell? A command-line interface (CLI) A new way of developing Windows and other products to be more manageable.
PowerShell Richard Siddaway Perot Systems. Welcome to this TechNet Event “Pick your Own Collateral” URL for on-line feedback is in your reminder .
Get-Intro –Name PowerShell Jason Helmick Systems Instructor Interface Technical Training.
MSG 334 Creating Exchange Administrative Scripting for the Non-Programmer Susan Hill Lead Programmer Writer Microsoft Corporation.
POWERSHELL ABOVE AND BEYOND: GUIS, WORKFLOWS, AND MORE Dean Corcoran Partner Service Account Manager (Cloud) – MCT – MCITP:EA Microsoft Australia SESSION.
DEV221 Windows Forms in Visual Studio 2005: An Overview Saurabh Pant Program Manager Microsoft Corporation.
Dynamic Languages Initiative Silverlight ASP.NET Web Services Summary.
Building Complete Web Application Using ASP.NET 3.5 & Visual Studio 2008 Omar Khan Group Program Manager Visual Studio.
Building More Powerful ASP.NET Applications with IIS7 Michael Volodarsky COM303 Program Manager Microsoft Corporation.
Mikael Deurell Senior Consultant Microsoft Mail: Blog: blogs.msdn.com/deurell.
PowerShell 5 & Windows 10. What are we covering today? What is PowerShell? Why is PowerShell important? Some simple demos on Windows 10.
Click to edit Master title style TechNet goes virtual ©2009 Microsoft Corporation. All Rights Reserved. TechNet goes virtual Windows Server 2008 R2 Remote.
PowerShell Chattanooga
TechEd /3/2018 4:18 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Windows PowerShell Remoting: Definitely NOT Just for Servers
Making PowerShell Useful
TechEd /21/2018 5:20 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA
PowerShell Best Practices for SQL DBA’s
Making PowerShell Useful
Windows PowerShell Crash Course
Deploying and Managing Windows To Go
Presentation transcript:

MGT305 Windows PowerShell Next Generation Command Line Scripting Jeffrey Snover & Leonard Chung Windows Enterprise Management Division

Keynote Reprise: Windows PowerShell has Released! Download Link Download Link Supported platforms Supported platforms Windows XP & Windows Server 2003 Windows XP & Windows Server 2003 Windows Vista version out shortly Windows Vista version out shortly Support for x86, x64, and ia64 Support for x86, x64, and ia64 Lots of Partners! Lots of Partners!

Microsoft Products Providing Windows PowerShell Cmdlets Windows Vista Exchange Server 2007 Operations Manager 2007 Windows Server “Longhorn” Virtual Machine Manager Data Protection Manager “V2”

Microsoft MVPs PowerShell Team Blog Active Newsgroup Channel 9: DFO Show IIS.net Visit for more infowww.microsoft.com/powershell TechNet ScriptCenter Exchange Server 2007 Terminal Server WMI, Registry, Hardware, etc. Community Submitted Scripts Windows PowerShell Ecosystem Partners 100s of Scripts MyITForum.com Manning Publications O’Reilly Publications Sapien Press and Other Publishers Community Support Books and Training Materials

Agenda Introduction Introduction What is Windows PowerShell? What is Windows PowerShell? Shell Shell Why is Windows PowerShell a great interactive shell? Why is Windows PowerShell a great interactive shell? Scripting Scripting How can I script with Windows PowerShell? How can I script with Windows PowerShell?

Windows PowerShell Next generation command line shell that is: Next generation command line shell that is: As interactive and composable as BASH/KSH As interactive and composable as BASH/KSH As programmatic as Perl/Ruby As programmatic as Perl/Ruby As production oriented as AS400 CL/VMS DCL As production oriented as AS400 CL/VMS DCL Allows access to data stores as easy to access as filesystems Allows access to data stores as easy to access as filesystems

Admin Tools Roadmap ScenarioTodayTomorrow PowerShell Benefits GUI Shell MMC MMC with snap-ins layered on PowerShell GUI-Cmd parity GUI-Cmd parity Auto script creation (V2) Auto script creation (V2) Command Shell CMDCMDPowerShell CMD and UNIX shell parity CMD and UNIX shell parity Command consistency Command consistency Namespaces as Drives (e.g. FS, Reg, WMI, AD, Certs, etc) Namespaces as Drives (e.g. FS, Reg, WMI, AD, Certs, etc) Command Scripting CMD scripting PowerShell Richer language Richer language Better text utilities Better text utilities COM Scripting WSH VBScript VBScript Jscript JscriptWSH VBScript VBScript Jscript Jscript Jscript (.net) PowerShell Richer language Richer language Object utilities Object utilities Common access to COM, XML,.NET, ADO, WMI, ADSI Common access to COM, XML,.NET, ADO, WMI, ADSI

Try things out in an interactive shell Try things out in an interactive shell Stitch things together with utilities Stitch things together with utilities Put the results in a script file Put the results in a script file Realize that the tools are unsuitable and restart with a new set of tools Realize that the tools are unsuitable and restart with a new set of tools Generalize (e.g., parameterize) Generalize (e.g., parameterize) Clean it up  production-quality Clean it up  production-quality Integrate into your environment Integrate into your environment Share with the community Share with the community Admin Development Model

The 4 Pillars of Discoverability 1. Get-Command 2. Get-Help and -? 3. Get-PSDrive 4. Get-Members

Once around the track Leonard Chung PowerShell Program Manager Windows Enterprise Management Division

Clear, Concise, Consistent, Learnable Get-Process | Where { $_.handles –gt 500 } | Sort handles | Format-Table Get-Process Cmdlet Common Windows PowerShell Parser Windows PowerShell Pipeline Processor Where Cmdlet Sort Cmdlet Format Cmdlet

Extending PowerShell with PowerGadgets Rene Garcia President PowerGadgets

How can I script with Windows PowerShell? Script against various: Script against various: Instrumentation: Text, COM,.NET, Cmdlets Instrumentation: Text, COM,.NET, Cmdlets Object types: WMI, XML, ADO, ADSI Object types: WMI, XML, ADO, ADSI Datastores: Filesystem, Registry, Certs, etc Datastores: Filesystem, Registry, Certs, etc Ad-hoc scripts need to be quick and easy Ad-hoc scripts need to be quick and easy Arguments don’t need to be named or typed Arguments don’t need to be named or typed Scripts don’t need to be signed Scripts don’t need to be signed Production scripts need be to production quality Production scripts need be to production quality Arguments can be typed, named and have initializers Arguments can be typed, named and have initializers Rich error handling Rich error handling Protection from uninitialized variables Protection from uninitialized variables Data can be written to multiple streams Data can be written to multiple streams Output, Error, Debug, Verbose, Warning, Progress Output, Error, Debug, Verbose, Warning, Progress Scripts can be digitally signed Scripts can be digitally signed

Simple Scripting Arguments not declared or typed Arguments not declared or typed function MyEcho { for ($i = 0; $i –lt $args.count; $i++) for ($i = 0; $i –lt $args.count; $i++) { “arg{0} = {1}” –f $i, $args[$i] “arg{0} = {1}” –f $i, $args[$i] }}

Advanced Scripting function Get-Total ( [String]$property = $(throw "Property Required"), [string]$formatString = "Total {1} = {0}" ) { Begin { $total = 0 { $total = 0 } Process Process { $total += $_.$property { $total += $_.$property } End End { $formatString -f $total,$property { $formatString -f $total,$property }} Arguments declared, typed, initialized

Sophisticated Scripting function Get-Types ( [ScriptBlock]$AssemblyFilter = {1}, [ScriptBlock]$TypeFilter = {$_.IsPublic –eq “TRUE”} ){ TRAP [System.Exception] {Write-Error “ERROR: $_.Exception”} TRAP [System.Exception] {Write-Error “ERROR: $_.Exception”} foreach ($a in [AppDomain]::CurrentDomain.GetAssemblies() | where $AssemblyFilter) { $a.GetTypes() | where $TypeFilter }} Uses.NET APIs, traps, ScriptBlocksUses.NET APIs, traps, ScriptBlocks

IDE Development Model PrimalScript Don Jones Sapien Technologies Inc

MySpace Dan Farino Chief Systems Architect MySpace.com

More Windows PowerShell Sessions PowerShell Scripting in Exchange Server 2007 (UCMCT05) PowerShell Scripting in Exchange Server 2007 (UCMCT05) Solving Management Problems with Windows PowerShell (MGT314) Solving Management Problems with Windows PowerShell (MGT314) Exploring Windows PowerShell Utilities (MGTCT08) Exploring Windows PowerShell Utilities (MGTCT08) Windows PowerShell Lightning Tour (MGTLD03) Windows PowerShell Lightning Tour (MGTLD03)

Ask The Experts Get Your Questions Answered You can find us at the Microsoft Ask the Experts area, located in the Exhibition Hall: Wednesday15 November10.15 – Thursday16 November10.15 – Thursday16 November14.45 – 15.45

Useful Resources Newsgroup: Microsoft.Public.Windows.PowerShell Channel 9 tag: Team blog: Script Center: Books: O’Reilly: Manning Press: Sapien Press: MshAnalyzer tool

Community Resources Newsgroup: Microsoft.Public.Windows.PowerShell Channel 9 tag: Team blog: Marc van Orsouw’s blog: Wiki: Script Center: O’Reilly book – Monad: Introducing the MSH Command Shell and Language Manning Press book by Bruce Payette: PowerShell in Action Sapien Press book by Don Jones: PowerShell MshAnalyzer tool

Resources Technical Chats and Webcasts Microsoft Learning and Certification MSDN & TechNet Virtual Labs Newsgroups communities/newsgroups/en-us/default.aspx Technical Community Sites User Groups

©2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.