Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting

Slides:



Advertisements
Similar presentations
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

Tech·Ed  North America /11/ :01 AM SESSION CODE: DEV405
6/12/ :53 PM DEV311 Deep Dive into Microsoft Visual Studio Team Foundation Server 2010 Reporting Steven Borg, Principal ALM Consultant Northwest.
TechEd /3/2018 4:18 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
9/11/2018 5:53 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
MDOP: Advanced Group Policy Management 4.0
Tech Ed North America /13/ :13 AM Required Slide
Excel Services Deployment and Administration
Возможности Excel 2010, о которых следует знать
Customer Experiences With Business Intelligence
Implementing RESTful Services Using the Microsoft .NET Framework
Windows PowerShell Remoting: Definitely NOT Just for Servers
Sysinternals Tutorials
Title of Presentation 11/22/2018 3:34 PM
11/21/2018 4:57 AM SIA303 Advanced Persistent Threats (APT): Understanding the New Era of Attacks! Marcus Murray Security Team Manager, Microsoft MVP –
What’s New In ASP.NET MVC 2
Open Data For The Enterprise
Advanced Dashboard Creation Using Microsoft SharePoint Server 2010
Jason Zander Unplugged
Branching and Merging Practices
Title of Presentation 12/2/2018 3:48 PM
High Availability: A Contrarian View
12/5/2018 3:24 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 7 Deployment en Masse
Team Foundation Server 2010 for Everyone
Authoring for Microsoft Silverlight 4 with Microsoft Expression Blend
Tech Ed North America /1/2019 2:58 AM Required Slide
Tech·Ed North America /2/2019 4:47 PM
Tech·Ed North America /17/2019 1:47 AM
Microsoft SharePoint Conference 2009 Jon Flanders
2010 Microsoft BI Conference
Building Silverlight Apps with RIA Services
2/27/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Tech Ed North America /5/2019 5:26 AM Required Slide
Tech Ed North America /12/2019 6:45 AM Required Slide
Silverlight Debugging
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
A Lap Around Internet Explorer 9 For Developers
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
TechEd /28/2019 7:58 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
2010 Microsoft BI Conference
Hack-proofing your Clients using Windows 7 Security!
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Lap Around the Windows Azure Platform
Code First Development in Microsoft ADO.NET Entity Framework 4.1
Building BI applications using PowerPivot for Excel
Title of Presentation 5/24/2019 1:26 PM
5/24/ :22 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
7/5/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Tech·Ed North America /6/2019 7:10 PM
Title of Presentation 7/24/2019 8:53 PM
Tech Ed North America /6/2019 2:07 PM Required Slide
Tech·Ed North America /7/2019 2:30 PM
What’s New in Visual Studio 2012 for Web Developers
Presentation transcript:

Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting Tech Ed North America 2010 12/4/2018 9:59 PM Required Slide SESSION CODE: WSV319 Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting Don Jones Senior Partner and Technologist Concentrated Technology, LLC © 2010 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.

Introductions Me: Don Jones, Concentrated Technology Microsoft MVP Award recipient Contributing Editor, TechNet Magazine Author of 45+ IT books Blogger at http://ConcentratedTech.com You: A Busy Windows Administrator Looking to enable single-seat administration Comfortable with command-line tools and utilities

Agenda About PowerShell Remoting Deploying PowerShell Remoting 1:1 Remote Shell 1:Many “Fan-Out” Remoting Sessions Implicit Remoting

How Remoting Works Utilizes WinRM v2 First shipped with PowerShell v2, installs with PowerShell v2 Auto-starts on servers, but not on clients (consider configuring to auto-start) Communicates via HTTP or HTTPS Default ports are not 80/443; ports can be customized Applications register with WinRM as an endpoint This tells WinRM the application is there WinRM must be configured to permit this (e.g., secure by default) Also: WS-MAN (Web Services for Management) is the protocol name

PowerShell Requirements PowerShell v2 only on both ends Ships with Win7 and Win2008R2; downloadable for Win2003, Vista, WinXP Must explicitly enable WinRM, register PowerShell as an endpoint, on machine that will accept incoming connections Run Enable-PSRemoting or Disable-PSRemoting (to disable) No configuration needed on computers that will initiate connections (e.g., where you are physically sitting) Remoting is a strong argument for deploying PowerShell v2 everywhere and enabling remoting Remoting can also be controlled via Group Policy object (download ADM template for Win2008 and Win2003; comes with Win2008R2)

DEMO Enabling Remoting Tech Ed North America 2010 12/4/2018 9:59 PM © 2010 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.

1:1 Remoting Think “SSH” functionality – interactive remote command line Use Enter-PSSession and computer name to start Use Exit-PSSession to “go home” and close the connection Help for Enter-PSSession shows parameters for specifying non-default ports, alternate credentials, etc.

DEMO 1:1 Remoting Tech Ed North America 2010 12/4/2018 9:59 PM © 2010 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.

1:Many Remoting Use Invoke-Command with a list of computer names (many ways to provide that list) Specify a command in a –scriptblock {}, or specify a –file to run Local files will be pushed out to the remote computer(s) -command is an alias for –scriptblock Separate multiple commands with ; in the scriptblock Throttled to 32 machines at once by default (can modify) Can specify alternate ports/credentials/etc Runs synchronously; use –AsJob to run as a background job

What Comes Back Results on the remote computers are serialized into XML for transmission across the wire PSComputerName property is added with the name of the computer each object came from (useful for sorting/grouping) XML is deserialized when received on your end, and turned back into objects Deserialized objects are not “live;” they are snapshots, and do not contain methods (e.g., they’re static) Ran as a job? Use Receive-Job to get the results objects from the job (specify –keep to keep the results cached, or capture them into a variable or something)

1:Many Remoting and Jobs Tech Ed North America 2010 12/4/2018 9:59 PM 1:Many Remoting and Jobs DEMO © 2010 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.

Sessions Specifying –computerName with Invoke-Command or Enter-PSSession creates a session, uses it, and then closes it Inconvenient if you want to connect to the same computer again and again, especially if you’re specifying ports/credentials/etc Use New-PSSession to create persistent connections Consumes memory/process (a tiny bit) on both ends Use Remove-PSSession to close connections; Get-PSSession to get a list of them Pass session to –session parameter of Invoke-Command or Enter-PSSession to re-use the session

DEMO Sessions Tech Ed North America 2010 12/4/2018 9:59 PM © 2010 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.

A Troubling Scenario New modules are shipping all the time – such as the ActiveDirectory module in Windows Server 2008 R2 These modules often can’t be installed on older versions of Windows The trick is to have remoting enabled on a machine where the module can be run… …and to use implicit remoting to make it look like that module is installed on your local computer

Implicit Remoting Use New-PSSession to create a session to the computer hosting the module Use Invoke-Command with that session to tell the remote computer to load the module into memory Use Import-PSSession to import the commands from that module to your local computer (temporarily) Specify a noun prefix if desired, to avoid overlap Run commands, even ask for help on them Use Remove-PSSession to close the connection when you’re done

DEMO Implicit Remoting Tech Ed North America 2010 12/4/2018 9:59 PM © 2010 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.

Summary WinRM implements the WS-MAN service that makes it work Enable remoting on receiving machines only Use Enter-PSSession and Invoke-Command Persistent sessions with *-PSSession Implicit remoting for easier access to remote modules Any last questions? Windows PowerShell v2: TFM on sale in the TechEd Bookstore!

Resources Learning Required Slide www.microsoft.com/teched Tech Ed North America 2010 12/4/2018 9:59 PM Required Slide Resources 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 © 2010 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.

Complete an evaluation on CommNet and enter to win! Tech Ed North America 2010 12/4/2018 9:59 PM Required Slide Complete an evaluation on CommNet and enter to win! © 2010 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.

Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st http://northamerica.msteched.com/registration   You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

Tech Ed North America 2010 12/4/2018 9:59 PM © 2010 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. © 2010 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.

Required Slide Tech Ed North America 2010 12/4/2018 9:59 PM © 2010 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.