1 Building Manageable Apps: Admin Scripting & Automation Jeffrey Snover Management Architect Microsoft Corporation Jeffrey Snover.

Slides:



Advertisements
Similar presentations
Jeffrey Snover Partner Architect Microsoft Corporation ES24.
Advertisements

And so to Code. Forward, Reverse, and Round-Trip Engineering Forward Engineering Reverse Engineering Round-Trip Engineering.
Programming Paradigms and languages
Jeffrey Snover | Distinguished Engineer & Lead Architect Jason Helmick | Senior Technologist, Concentrated Technology.
Brian Alderman | MCT, CEO / Founder of MicroTechPoint Pete Harris | Microsoft Senior Content Publisher.
Microsoft PowerShell Tom Roeder CS fa. Motivation.NET as a platform shell web server database access Native access to resources eaiser to manage.
MGT305 Windows PowerShell Next Generation Command Line Scripting Jeffrey Snover & Leonard Chung Windows Enterprise Management Division.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Monad: Microsoft’s Next Generation Command Shell Thomas Lee Chief Technologist QA plc.
Technical Overview. PLEASE READ (hidden slide) To deliver this presentation effectively, you need to be familiar with Windows Server 2008 R2 management.
 Jeffrey Snover Partner Architect Microsoft Corporation.
Jeffrey Snover Distinguished Engineer Microsoft Session Code: SRV312.
Future Directions for Leveraging Advanced XML Tools and Building Custom XML Solutions Denise Draper DAT321 Microsoft Corporation.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
Windows Vista: Volume Activation 2.0
1 Monad – A New Command Shell Jeffrey Snover, Architect James Truher, Program Manager TLN303 Microsoft Corporation.
Using the Actions Pane, Host Controls, and Smart Tags
Appendix A Starting Out with Windows PowerShell™ 2.0.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Exploring an Open Source Automation Framework Implementation.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Reset and Recycle IIS Reset Application Pool Management Error Codes New HTTP Sub-status codes Custom/Detailed Errors Tracing in IIS7 and.
Visit our Focus Rooms Evaluation of Implementation Proposals by Dynamics AX R&D Solution Architecture & Industry Experts Gain further insights on Dynamics.
DEV333 Instrumenting Applications for Manageability with the Enterprise Instrumentation Framework David Keogh Program Manager Visual Studio Enterprise.
Microsoft Australia Security Summit Design for Operations Nigel Watson, Microsoft Australia David Lemphers, TeamForce Nigel Watson, Microsoft Australia.
This is the main tracing and diagnostics presentation. Very important that this be practical and useful information. IT Pro audience is very.
AUTOMATING DAAS DESKTOPS WITH CITRIX CORTEX Tony Sanchez WW Alliances Solutions Architecture Citrix Systems Inc SESSION CODE: CLI415 (c) 2011 Microsoft.
Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Windows PowerShell Introduction 1 Morgan Simonsen Ementor.
Federico Guerrini IDA TSP, EMEA Incubation Team From Identity Synchronization to Identity Management.
Bart J.F. De Smet Software Development Engineer Microsoft Corporation Session Code: DTL315.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Virtual techdays INDIA │ august 2010 virtual techdays INDIA │ august 2010 Building the Road to Private Cloud M.S.Anand │ Technology Evangelist,
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
POWERSHELL ABOVE AND BEYOND: GUIS, WORKFLOWS, AND MORE Dean Corcoran Partner Service Account Manager (Cloud) – MCT – MCITP:EA Microsoft Australia SESSION.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Mikael Deurell Senior Consultant Microsoft Mail: Blog: blogs.msdn.com/deurell.
Arizona SharePoint Professionals Group.
Tools and Tips for Administering Office 365
Deployment Internals: Mastering Windows Deployment Services
Azure on Steroids: Full Automation with PowerShell
6/11/2018 8:14 AM THR2175 Building and deploying existing ASP.NET applications using VSTS and Docker on Windows Marcel de Vries CTO, Xpirit © Microsoft.
Optimizing Microsoft OneDrive for the enterprise
TechEd /3/2018 4:18 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Customizing your device experience with assigned access
Adaptive Code Umamaheswaran Senior Software Engineer
What’s New in Accessibility (for Developers and Users)
Build /21/2018 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
Myth Busting: Hosted Web Apps
Power Apps & Flow for Microsoft Dynamics SL
Reaching more customers with accessible Metro style apps using HTML5
Microsoft Build /8/2018 8:41 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
持續的產出Windows Azure 雲端服務
"Oslo”: Customizing and Extending the Visual Design Experience
11/23/2018 8:30 AM BRK3037 BRK3037: Dive deep on building apps and services with the Office 365 Communications Platform David Newman Senior Program Manager.
Real World Scenarios with Service Manager and Orchestrator – Best in Breed Together
TechEd /11/ :44 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Windows Server 2008 Iain McDonald Director of Program Management
Delivering great hardware solutions for Windows
Service Template Creation from the Ground Up
Tech Ed North America /27/ :04 AM Required Slide
DEV322 Visual Studio 2005 C# IDE Enhancements
Service Template Creation from the Ground Up
Mark Quirk Head of Technology Developer & Platform Group
PnP Partner Pack - Introduction
Presentation transcript:

1 Building Manageable Apps: Admin Scripting & Automation Jeffrey Snover Management Architect Microsoft Corporation Jeffrey Snover Management Architect Microsoft Corporation Session Code: ARC-334

2 Make the connection Kernel Mode Framework Models Base Services Kernel Hardware Abstraction Layer Base Operating System Services CLR Health & Instrumentation Management Services System.Management.Instrumentation System.Management System.Diagnostics System.Diagnostics.Events System.Management.Monitoring Task & Automation System.Management.TaskScheduler System.Management.Automation System.Management.TaskScheduler.UI Settings & Configuration System.Configuration.Settings

3 Windows DSI Architecture (ARC230) Design for Operations Dynamic System Services SDM Store Dynamic Data Center STORAGESERVERSNETWORKING Settings ARC333 Tasks ARC334 Health ARC332 Hardware Managed Node Managed System Management Tools Dev Tools Local Node Mgmt System Level Management Remote Node Mgmt Your Application Your System Definition SDM Service

4 Task-Based Management Abstractions match activities of the user Add a user – canonical example Create account in AD Create home directory Add to Groups Customer-specific setup … Surfaced to enable automation Requires command line access! Abstractions match activities of the user Add a user – canonical example Create account in AD Create home directory Add to Groups Customer-specific setup … Surfaced to enable automation Requires command line access!

5 Introduction Weak cmd shell Weak language spotty coverage GUI focus Hard to automate SDK Focus Programmers Weak cmd shell Weak language spotty coverage GUI focus Hard to automate SDK Focus Programmers Foundation for task- based management Focused on power users and admins Provides: Interactive shell Cmdlets Utilities Scripting language Remote scripting Solution: MSH Problem

6 MSH Elements Core concepts Pipelines and utilities Parameters and confirmation Records and errors Navigation Core concepts Pipelines and utilities Parameters and confirmation Records and errors Navigation

7 Core Concepts Command line scripting language Best of sh/ksh, Perl/Ruby, DCL/CL Commands are classes (Cmdlets) Hosting model Command line scripting language Best of sh/ksh, Perl/Ruby, DCL/CL Commands are classes (Cmdlets) Hosting model

8 … using public class { public override void { (Process.GetProcesses()); } System.Management.Automation Commands Are Classes GetPs : Cmdlet [CmdletDeclaration("get", "ps")] WriteObjects StartProcessing()

9 Cmdlets Or … What Do I Get For 5 Lines Of Code? James Truher MSH Program Manager

10 How It Works AutoRegistration Parser maps to your DLL MSH manages the DLL and Class lifecycle AutoRegistration Parser maps to your DLL MSH manages the DLL and Class lifecycle

11 Pipeline And Utilities Concepts  Pipelines are Cmdlets passing structured objects  Reflection-based utility Cmdlets  Pipelines are Cmdlets passing structured objects  Reflection-based utility Cmdlets

12 Pipeline & Utilities Or… Was That All I Got For 5 Lines Of Code? James Truher MSH Program Manager

13 How It Works get/process | where “handlecount –gt 500” | sort handlecount | format/table GetProces s Class Common MSH Parser MSH Pipeline Processor Where Class Sort Class Format Class

14 CLIs And GUIs Not either/or Admins need more than GUIs typically deliver Planning & review Guaranteed consistency Massive productivity You need to support both Not either/or Admins need more than GUIs typically deliver Planning & review Guaranteed consistency Massive productivity You need to support both Background

15 Composable Management Traditional Model A | B | C Tight coupling between Parse, Get, Process, Output Relies on parsing text.NET allows us to do better Finer grain pipeline Objects instead of text Traditional Model A | B | C Tight coupling between Parse, Get, Process, Output Relies on parsing text.NET allows us to do better Finer grain pipeline Objects instead of text Background

16 Cost Benefits # of Functions Traditional Model Economics Costs: Dev Test Training MSH Common Engine combined with Utility Cmdlets New Model Background

17 Glide Path ShowScript Reflection Background GUI Cmd VS

18 MMC or… How Do GUIs Work With This? Mark Hong MMC Dev Lead

19 Parameter And Confirmation Concepts Common parser Driven by fields/properties + attributes Use Confirmation model Common parser Driven by fields/properties + attributes Use Confirmation model

20 Parameters And Confirmation [CommandDeclaration("stop", "ps")] public class StopPs: Cmdlet { public string ProcessName; public override void ProcessRecord() { Process [ ]ps; ps = Process.GetProcessesByName(ProcessName); foreach (Process p in ps) { p.Kill(); } [CommandDeclaration("stop", "ps")] public class StopPs: Cmdlet { public string ProcessName; public override void ProcessRecord() { Process [ ]ps; ps = Process.GetProcessesByName(ProcessName); foreach (Process p in ps) { p.Kill(); } [ParsingMandatoryParameter] [ParsingPromptString(“Name of the process")] if (ConfirmProcessing(p.ProcessName))

21 Parameters/Confirmation Or… So What Do Those 3 Lines Of Code Get Me? James Truher MSH Program Manager

22 How It Works Parameter Attributes PrerequisiteMachineRole PrerequisiteUserRole PrerequisteScript PrerequisiteUIType ParsingParameter ParsingAllowPipelineInput ParsingParameterMapping ParsingVariableLengthParameterLi st ParsingInteraction PrerequisiteMachineRole PrerequisiteUserRole PrerequisteScript PrerequisiteUIType ParsingParameter ParsingAllowPipelineInput ParsingParameterMapping ParsingVariableLengthParameterLi st ParsingInteraction ParsingPasswordParameter ParsingPromptString ValidationRange ValidationLength ValidationCount ValidationFileAttributes ValidationNetworkAttribute ValidationPattern ExpandWildcards PredicatesParsing Data Validation Data GenerationData Presentation

23 How It Works public bool ConfirmProcessing(string Action) { } if (Confirm) { return Prompt(Action + “Continue [y/n/!]”); } if (Whatif) { WriteLine(“# “ + Action); return false } if (Confirm) { return Prompt(Action + “Continue [y/n/!]”); } if (Verbose) { Writeline(Action); return true; } if (Whatif) { WriteLine(“# “ + Action); return false } Pseudo-code

24 Records And Errors Concepts  MSH is Record oriented Records come from the Cmdline or the PipeLine Parameters define or contribute to a record Pipeline objects are processed into Records  Errors are first class citizens Policy driven error handling  MSH is Record oriented Records come from the Cmdline or the PipeLine Parameters define or contribute to a record Pipeline objects are processed into Records  Errors are first class citizens Policy driven error handling

25 [CommandDeclaration("format", "ps")] public class FormatPs: Command { public string ProcessName; public int HandleCount; public override void StartProcessing() { WriteObject(“Caution – data may be false”); } public override void EndProcessing() { WriteObject(“Done”)); } [CommandDeclaration("format", "ps")] public class FormatPs: Command { public string ProcessName; public int HandleCount; public override void StartProcessing() { WriteObject(“Caution – data may be false”); } public override void EndProcessing() { WriteObject(“Done”)); } Record Orientation public override void ProcessRecord() { WriteObject( ProcessName + “:” + HandleCount ); } public override void ProcessRecord() { WriteObject( ProcessName + “:” + HandleCount ); } if (record++ > 5 && record < 10) WriteErrorObject(CurrentPipelineObject, new Exception("Invalid record")); [ParsingAllowPipelineInput]

26 Records And Errors Or … Why This Isn’t Like Your Dad’s Shell James Truher MSH Program Manager

27 How It Works StartProcessing() for each object Pipeline Convert object into a record Apply command line params ProcessRecord() EndProcessing() StartProcessing() for each object Pipeline Convert object into a record Apply command line params ProcessRecord() EndProcessing()

28 Ubiquitous Navigation FileSystems are easy to use Navigation and manipulation are universal Other stores are hard Require domain-specific utilties and concepts How do we make other stores easy? Interact with them like FileSystems FileSystems are easy to use Navigation and manipulation are universal Other stores are hard Require domain-specific utilties and concepts How do we make other stores easy? Interact with them like FileSystems

29 Navigation Provider Concepts  You Subclass and we provide the Cmdlets Dir, cd, pushd, popd, cat, delete, rename, copy, clear,  Providers need to be registered  Requests to providers are stateless and use absolute names  You Subclass and we provide the Cmdlets Dir, cd, pushd, popd, cat, delete, rename, copy, clear,  Providers need to be registered  Requests to providers are stateless and use absolute names

30 Navigation Provider [ProviderDeclaration("REG", "Registry", ProviderCapabilityFlags.None)] public class RegistryProvider : NavigationCmdletBase { protected override void GetItem(string path) { RegistryKey key = GetRegkeyForPath(path, false); if (key == null) { WriteErrorObject(path, new ArgumentException("does not exist")); } WriteObject(key); }.... } [ProviderDeclaration("REG", "Registry", ProviderCapabilityFlags.None)] public class RegistryProvider : NavigationCmdletBase { protected override void GetItem(string path) { RegistryKey key = GetRegkeyForPath(path, false); if (key == null) { WriteErrorObject(path, new ArgumentException("does not exist")); } WriteObject(key); }.... }

31 Navigation Provider – Or What Whackball Would Treat Registry Like A Filesystem? James Truher MSH Program Manager

32 How It Works MSH Engine Core Command Base Classes Core Commands (get, set, rename, move, push, pop, …) FileSys Provider Cmdlet … Registry Provider AD Provider

33 Longhorn Command Shell (MSH) Preview Available on Use the guest account: mshPDChttp://betaplace.com Logon and password ed within 24 hours Download bits, SDK, samples, private newsgroup and a feedback/bug reporting environment. Available on Use the guest account: mshPDChttp://betaplace.com Logon and password ed within 24 hours Download bits, SDK, samples, private newsgroup and a feedback/bug reporting environment.

34 Call To Action  Write managed code interfaces to your services and objects  Design your task model  Write Cmdlets for invariant actions  Write MSH scripts for actions which vary between customers  Write Navigation providers to expose namespaces  Write managed code interfaces to your services and objects  Design your task model  Write Cmdlets for invariant actions  Write MSH scripts for actions which vary between customers  Write Navigation providers to expose namespaces

35 HAPPY BIRTHDAY To JIM TRUHER

36 © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.