Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1

2 Corey Hynes HynesITe, Inc Session Code: SRV317

3 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

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

5 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

6 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

7 Tools PowerShell Console PowerShell ISE Modules Remoting Forms

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

9 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

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

11 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

12 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

13 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

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

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

16 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

17 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.

18 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

19 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.

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

21 Running commands across many systems

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

23 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

24 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

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

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

27

28 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

29 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

30 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)

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

32

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


Download ppt "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."

Similar presentations


Ads by Google