jeffrey snover partner architect microsoft corporation es24
TRANSCRIPT
![Page 1: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/1.jpg)
Using PowerShell to Create Manageable Web Services
Jeffrey SnoverPartner ArchitectMicrosoft Corporation
ES24
![Page 2: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/2.jpg)
Deliver great management (cheaply)? Satisfy the full range of Admins? Automate operation of LOTS of
heterogeneous stuff (including raw HW)? Enable users to SAFELY do their own
management? Integrate into my customer’s
management system?
When Building A WS, How Do I…?
![Page 3: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/3.jpg)
PowerShell V1 PowerShell V2 Managing
Raw Hardware and other OSes Single Machines Sets of Machines
Scalable remote administration
Agenda
![Page 4: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/4.jpg)
Windows PowerShellNew command-line shell and scripting language
• As interactive and composable as BASH/KSH• As programmatic as Perl/Python/Ruby• As production oriented as AS400 CL/VMS DCL• Allows access to data stores as easy to access as filesystem
![Page 5: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/5.jpg)
Universal Automation Environment
Automation FrameworksAutomation Frameworks
Automation Frameworks
Cmdlets
In-Proc, Local, RemoteRuntime Engines
In-Proc, Local, RemoteRuntime Engines
In-Proc, Local, RemoteRuntime Engines
Automation Platform (API)
ScriptingLanguage
Type Normalizers
Type Normalizers
Type Normalizers
Providers Events, Jobs, Transactions
Shells, ISEs, GUI s, Applications Universal• Interactive or programmatic• Wide range of OSes• Local or Remote• Single or Multi Machine• Synch or Asynch• Wide range of authentication mechanisms• .NET, native code, COM, WMI, ADSI, XML, ADO, WebServices, WSMAN, etc• Simple scripting to systems programming
Powered by a strong community
![Page 6: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/6.jpg)
Writing Cmdlets
Demo
![Page 7: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/7.jpg)
PowerShell V2 Goals
Reduce the cost and effort to: Use PowerShell
Get, learn, share scripts Layer applications on PowerShell
GUI, web, workflow, etc. Manage anything/everything
Servers, clients, distributed systems, applications, web services, cloud services, raw HW, other OSes, everything
Using any and all mechanisms (WMI, .Net, native code, web services, WSMAN)
![Page 8: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/8.jpg)
Who Does What?V1 V2
Developer •Cmdlets and/or providers• Help
•PowerShell cmdlets •Transaction support
PowerShell • CLI & API
• Rich language w/access to com, wmi, .Net, adsi, xml & ado
• Utilities to manipulate, format, import/export
• 129 Cmdlets
•Web service & workflow activities
•Richer language w/access to web services, unmanaged code, wsman
• Richer utilities including eventing, job control, remote execution
• 241 Cmdlets
•Graphical ISE to create/debug scripts
Users •Simple ad hoc scripts•Sophisticated production scripting
•Systems programming•Across multiple machines
Community • Write and share scripts • Write and Share Modules
V1 Scripts and Cmdlets run on PowerShell V2
![Page 9: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/9.jpg)
PowerShell V2 in Windows 7PowerShell V2 in Server Core
Announcing
![Page 10: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/10.jpg)
Managing Raw HW and Other OSes
Management initiative driven by DMTF Platform independent, interoperable & industry
standard management solution CIM based standards for Server and Desktop management WS-Management (WSMAN)
ITConsole
ManagedPlatforms
WSMAN
![Page 11: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/11.jpg)
Raw HW Management - Examples
Power control and boot control HW/ SW inventory Alerts and lifecycle events Config/manage BIOS Software and Firmware update Health monitoring
![Page 12: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/12.jpg)
Hardware Sample Commands
Power Off Command
Invoke-WSManAction -CN $svr -cred $cred -port 16992 `-Auth digest CIM_ComputerSystem `–Action RequestStateChange `–SelectorSet @{Name="ManagedSystem"} `-valueSet @{RequestedState="3"}
Chassis Class Get-WSManInstance -CN $svr -cred $cred -port 16992 -Auth digest -enum CIM_Chassis
Chip Class Get-WSManInstance –CN $srv -cred $cred -port 16992 -Auth digest -enum CIM_Chip
Power On Command
Invoke-WSManAction -CN $svr -cred $cred -port 16992 `-Auth digest CIM_ComputerSystem `–Action RequestStateChange `–SelectorSet @{Name="ManagedSystem"} `-valueSet @{RequestedState=“2"}
![Page 13: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/13.jpg)
Managing Raw Hardware & Other OSes
Demo
![Page 14: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/14.jpg)
Fine Grain Control For Working Across The Web
New-WSManSessionOption [-NoEncryption ] [-OperationTimeout <0->] [-ProxyAccessType <ProxyAutoDetect | ProxyIEConfig |
ProxyNoProxyServer | ProxyWinHttpConfig>] [-ProxyAuthentication <Basic | Digest | Negotiate>] [-ProxyCredential <PSCredential>] [-SkipCACheck ] [-SkipCNCheck ] [-SkipRevocationCheck ] [-SPNPort <0->] [-UseUTF16 ]
![Page 15: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/15.jpg)
Managing Single Machines
Remote WMI Remote Command/Script Execution Remote Background Jobs Remote Interactive Session BITS
![Page 16: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/16.jpg)
BITS
Background Intelligent
Utilizes only idle network bandwidth. Throttles usage to preserve the user’s interactive experience.
Admin schedulable bandwidth usage limits Prioritized transfers Peer Caching Resumable
Transfer HTTP/HTTPS & SMB downloads/uploads
Used by over 600 million users worldwide
![Page 17: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/17.jpg)
Managing Single Machines
Demo
![Page 18: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/18.jpg)
WMI -ComputerName <string[]> -Throttle <int> -AsJob
PS> gwmi -CN (cat servers.txt) Win32_Bios -Throttle 64 | Select __Server, Name, Manufacturer, Version | ConvertTo-Html > BiosInventory.htm
PS> $job = gwmi -CN (cat servers.txt) Win32_Bios -Throttle 64 –AsJob PS> Wait-job $j # or go do something else PS> Receive-Job $j |
Select __Server, Name, Manufacturer, Version | ConvertTo-Html > BiosInventory.htm
Managing Sets Of Machines
![Page 19: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/19.jpg)
Invoke-Command can run expressions, commands and/or ScriptBlocks In the foreground or background
-AsJob On one or more machines
-ComputerName <string[]> Over a LAN or a WAN
-SessionOption <SessionOption> In restricted or unrestricted environments
- -ConfigurationName <String> Using short or long connections
-Session <RemoteRunspaceInfo[]> Using impersonation or supplied credentials
-Credentials
Register-PSEvent –Action <ScriptBlock>
Managing Sets Of Machines
![Page 20: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/20.jpg)
Customer admin experience across the Web Different customers & different roles
Access different commands Have different options on the same commands
Interactive & scripting On-the-fly generation of
“virtual” commands
Scalable Remote Administration
![Page 21: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/21.jpg)
New ISS extension module: WSMAN WSMan plugin – PowerShell
Exposes a Resource URI Creates a new Session for every user running
on an impersonated thread Startup script configures the Session
Language: Full, Restricted, None Commands External applications Scripts Providers
Details
![Page 22: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/22.jpg)
Company1
[email protected] [email protected]
SMB2
[email protected] [email protected]
WW
Hosting Service – Data Farm
CoolLabs.com
![Page 23: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/23.jpg)
SMB2
WW
W
Runspace [email protected]
Runspace [email protected]
[email protected] [email protected]
Company1
[email protected]@Company2.com
![Page 24: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/24.jpg)
Scalable Remote Administration
Demo
![Page 25: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/25.jpg)
Remote Programming
Demo
![Page 26: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/26.jpg)
Deliver great management (cheaply)? Satisfy the full range of Admins? Automate operation of LOTS of
heterogeneous stuff (including raw HW)? Enable users to SAFELY do their own
management?
When Building A WS, How Do I…?
Windows PowerShell V2
![Page 27: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/27.jpg)
Q&A
![Page 28: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/28.jpg)
Evals & Recordings
Please fill
out your
evaluation for
this session at:
This session will be available as a recording at:
www.microsoftpdc.com
![Page 29: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/29.jpg)
© 2008 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.
![Page 30: Jeffrey Snover Partner Architect Microsoft Corporation ES24](https://reader035.vdocuments.us/reader035/viewer/2022062619/5518cd02550346b31f8b5af8/html5/thumbnails/30.jpg)