Corey Hynes HynesITe, Inc Session Code: SRV317 Objectives Let you walk out of here, being able to run a script against an OU of computers, to make some.

Slides:



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

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
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.
Feature: Payroll and HR Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Tech·Ed North America /19/2017 7:21 AM
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Appendix A Starting Out with Windows PowerShell™ 2.0.
Windows Azure Connect Name Title Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Visit our Focus Rooms Evaluation of Implementation Proposals by Dynamics AX R&D Solution Architecture & Industry Experts Gain further insights on Dynamics.
demo Instance AInstance B Read “7” Write “8”

customer.
Paul Cooke - CISSP Director Microsoft Session Code: CLI322.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
Windows Azure SQL Data Sync Name Title Microsoft Corporation.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 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.

Mikael Deurell Senior Consultant Microsoft Mail: Blog: blogs.msdn.com/deurell.
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Excel Services Deployment and Administration
Windows PowerShell Remoting: Definitely NOT Just for Servers
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Title of Presentation 12/2/2018 3:48 PM
Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
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.
Feature: Sort order stored with Default View
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Service Template Creation from the Ground Up
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Managing Windows Server 2008
Presentation transcript:

Corey Hynes HynesITe, Inc Session Code: SRV317

Objectives Let you walk out of here, being able to run a script against an OU of computers, to make some sort of global configuration change

Assumption You understand fundamental PowerShell You are willing to learn how to write code

What will we cover? PowerShell V2 tools Remoting Modules Lots of details about individual modules PowerShell code to run commands against multiple computers Tips and Tricks Lots of Demos

PowerShell, why you should care? New model for administration and administrative tools Gives ITPro’s the same ability as a developer to manipulate Windows GUI now runs on PowerShell Scripts, samples, guidance, all come as PowerShell scripts

Tools PowerShell Console PowerShell ISE Modules Remoting Forms

PowerShell ISE Simplify authoring of scripts Save Execute partial scripts Debug Color coding Default on Win7 Add to R2

Remoting This is what makes this session possible Module: None, build in. Key Cmdlets Invoke-Command New-PSSession Enter-PSSession Exit-PSSession Notes Must be enabled, GUI or Enable-PSRemoting

RunSpaceRunSpace IP LAN ScriptBlockScriptBlock Conceptual Model of Remoting Get-ServiceGet-Service ResultsResults

Working in Interactive Sessions Key Cmdlets Enter-PSSession to start a new session Exit-PSSession to end a new session Session objects New-PSSession Note Interactive sessions are not supported on Core

Modules Discrete collections of cmdlets Can be authored and deployed to give you “packages” of functionality Stored in file system System32\WindowsPoweshell\1.0\Modules Roles and Features add new Cmdlets You can use a remote computer’s modules

Working with Modules Import-Module to load a module Get-Module to load a module Get-Command –Module to see what is in a module

How to perform some really simple and easy things…..

TroubleShooting Packs Known as the “troubleshooters” Module: Troubleshootingpack Key Cmdlets Get-Troubleshootingpack Invoke-Troubleshootingpack Notes C:\Windows\Diagnostics\System contain build-in troubleshooting packs

Role and Feature Management Replaces ServerManager.exe Module: ServerManager Key Cmdlets Get-WindowsFeature Add-WindowsFeature Properties Name, Parent, Installed, Dependson Notes Server Core, have to add ServerManager-PSH- Cmdlets

Group Policy Replaces: Lots of little tools and scripts Module: GroupPolicy (part of GPMC) Key CmdLets Get-GPO, New-GPO Backup-GPO Copy-GPO Get-GPOReport Notes Limited ability to “edit” GPO.

Active Directory Replaces: Scripts that were shipped with previous versions Module: Active Directory Key CmdLets: Way too many to list Over 75 Cmdlets Notes Requires that you have one 2008 R2 DC running the AD Web Service

Best Practices Replaces: Nothing, brand new Module: BestPractices Key Cmdlets Get-BPAModel Invoke-BPAModel Notes: Not all roles have BPA models that can be run. Updates via Microsoft Update.

Additional Modules ADRMS – Rights Management ADRMSAdmin – Rights Management Admin AppLocker BitsTransfer FailoverClusters RemoteDesktopSearvices WebAdministration NetworkLoadBalancing

Running commands across many systems

Known Systems If you know the names and quantity of your targets Use Invoke-Command with –ScriptBlock and multiple computer names

Unknown Systems If you do not know the names/quantity You have to query for that information Many options Query from file Query from Active Directory Query results in a collection of computer names Use a foreach loop to pass instructions to each computer

Executing more Complicated Scripts You can’t always write a One-Liner To complex Hard to read Multi-line Scriptblock Use { and } with ; to separate the lines Exectute the script

Loops Key item to know is ForEach loop Simple Strucure ForEach ($Object in $Objects) { $Object.DoSomething }

Running “normal” commands Not straight forward Need to combine command and parameters Suggestion Shell using Cmd /C Provide/construct string as command to run

How do I do this? Enable remote management Server Manager on WS08 R2 PowerShell on ServerCore PowerShell on Win7 Firewall Rules and Authentication Authentication is Kerberos Security is WMI based security Firewall rules Allow port 5985 for HTTP

A word on Security Big topic, not this session In general Authentication is Kerberos/NTLM or specified Wire encryption can be HTTPS or IPSec HTTPS part of WINRM configuration IPSec outside WINRM Remoting disabled by default You can restrict what remote sessions can do Query data, make changes, all or none

Related Material WSV08-HOL - Introduction to Windows PowerShell Fundamentals (40, 88, 3.14) WSV03-HOL - Advanced Windows PowerShell Scripting (38, 54, 3.19) WSV19-HOL - Windows Server 2008 R2: Server Management and Windows PowerShell V2 (39, 29, 3.34) WSV20-HOL - Windows Server 2008 R2: What's New in Microsoft Active Directory (38, 53, 2.76)

Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!

© 2009 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