1 Windows PowerShell Fundamentals Steven Murawski Senior Windows Systems Engineer Microsoft MVP This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
2 Who I am Name Steven Murawski Occupation Senior Windows System Engineer Blog UsePowerShell.com Twitter Microsoft MVP - PowerShell
3 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange Q & A (time permitting)
4 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange Q & A (time permitting)
5 Command Line What is PowerShell?
6 What is PowerShell? Scripting Language
7 What is PowerShell? Most importantly though it is an Automation Tool. PowerShell offers a unifying management surface in which to manage your Windows (and other) environment.
8 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
9 Terminology Cmdlet Functions Objects Pipeline
10 Terminology Cmdlets The basic unit of work in PowerShell. These are PowerShell s native commands. They are called cmdlets (small commands) because they embrace the Unix philosophy of small tools which can be used compose new solutions
11 Terminology Functions Functions are a series of PowerShell statements (or commands) that are given a name and saved in memory for a particular session. There are several types of functions: V1 style function Filter Advanced function
12 Terminology Objects PowerShell is an object-based shell. Objects are a binding of data and actions. What this really means is that when you execute a command, you can more easily ask questions of the result. Being object based also gives PowerShell the ability to provide generalized format, display, and export capabilities.
13 Terminology Pipeline The pipeline is a central concept in PowerShell which allows you to take the output from one command and make it the input for the next command. It has long been the case that shell commands can take input from other commands (or files, or other sources). The pipeline in PowerShell can leverage the object based and utilize some components of the runtime to make transitions between commands more effective.
14 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
15 The Big Four Navigational And Discovery Commands Get-Command Get-Help Get-Member Get-PSDrive
16 The Big Four Get-Command Get-Command will list any valid command (executables, functions, cmdlets, aliases). It can also provide some additional metadata about PowerShell commands and scripts.
17 The Big Four Get-Help This is the man equivalent for PowerShell. Get-Help offers several levels of help Basic Detailed Full Examples Individual Parameters
18 The Big Four Get-Member Since PowerShell is an object-based shell, Get- Member allows you to examine the objects output from different commands. This is probably the most important discovery command.
19 The Big Four Get-PSDrive PowerShell offers the capability to expose various information sources (providers) like a file system. Get-PSDrive lists the mapped providers and where or how they are mounted.
20 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
21 Working From the Shell Navigating Providers Providers offer a way to navigate different data sources via the same commands. Providers File System Registry Others
22 Working From the Shell Navigating the File System Items and Containers Item Properties
23 Working From the Shell Digging in the Registry PowerShell provides access to the registry via a provider. This allows the registry to be navigated like the file system. Keys and subkeys are represented as items (like files and directories. Registry values and data are represented as properties of the items.
24 Working From the Shell Other Providers Built in Alias Certificate File System Function Registry Variable WSMan Others SQL Server Active Directory
25 Working From the Shell Dealing with Objects Formatting Output Filtering Output Using the Pipeline
26 Working From the Shell Formatting Output Format-Table Format-List Format-Custom ConvertTo-XML ConvertTo-HTML ConvertTo-CSV Export-CliXML Export-CSV
27 Working From the Shell Filtering output Native Filtering in Commands Usually preferred, but can vary based on the command and data type. If the target of the command is remote, filtering could be done at the source. Where-Object Uses a scriptblock (PowerShell statements surrounded by braces) Works on any object in the PowerShell Pipeline Works locally in the current PowerShell session
28 Working From the Shell Using the Pipeline PowerShell pipes objects. Cmdlets, scripts, and functions can take full objects as arguments. Properties of objects can be automatically mapped to parameters of cmdlets, scripts, or functions. Scriptblocks can be used to transform input.
29 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
30 Working with Workstations and Working with WMI Servers Get-WMIObject is the key command when working with WMI. Get-WMIObject List What s stored in WMI? Just about everything! Hardware information System Configuration Application Data And more..
31 Working with Workstations and Servers Editing the Registry Via the Provider Can use it locally Can use it remotely if PowerShell Remoting is enabled. Using.NET More familiar to.net developers. Using WMI More familiar to those with VBScript experience
32 Working with Workstations and Servers Working with Text Select-String Operators Match Replace Split Regular Expressions
33 Working with Workstations and Servers Working with Remote Machines WMI Available on most machines. Requires a knowledge of WMI (which is not very consistent) PowerShell Remoting Requires Windows XP SP3/Server 2003 SP2 or higher and WinRM
34 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
35 Working with Active Directory ADSI Available on any machine Obscure Quest s AD Cmdlets Task based Excellent Coverage Server 2003 Domains or above 3 rd Party Microsoft s AD Module Only available on Windows 7 or Server 2008 R2 Server 2003 Domains or above. If DC s are not 2008 R2, AD Web Services are required.
36 Working with Active Directory Common Tasks Resetting Passwords Finding Disabled Users Finding Expired Computer Accounts
37 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
38 Working with Exchange Common Tasks Monitor Message Queues (Exchange 2003) Monitor Message Queues (Exchange 2007/2010) Identify all ActiveSync Devices Connected (Exchange 2010)
39 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
40 V3 Sneak Peak PowerShell V3 Windows 8 Workflows Resilient Sessions Disconnected Sessions Autoloading of Modules And more
41 Agenda What is PowerShell? Terminology The Big 4 Working from the Shell Workstations and Servers Active Directory Exchange PowerShell V3 Sneak Peak Q & A (time permitting)
42 Q and A I m sure no one has any questions, so we can just hang out.. But on the off chance that some has any questions, where can we get some answers? PowerShell.Org ServerFault.com UsePowerShell.Com
Departmental IT Staff (CatNet OU Admin) Guide to Exchange 2010 Submitted to: University of Arizona Prepared by: Table of Contents Active Directory... 4 Overview and Terminology... 4 CatNet Architecture...
Ipswitch WhatsUp Professional and Premium Edition 2006 User s Guide Software Version 2 Ipswitch, Inc Ipswitch Inc. Web: HTTP://www.ipswitch.com 10 Maguire Rd, Suite 220 Phone: 781.676.5700 Lexington, MA
8 Backing Up and Recovering Your Server In this chapter, you will learn to: Understand Backup and Recovery (Pages 254 262) 33n Understand Backup and Recovery Terminology (Page 255) n Use Backup and Recovery
Acronis Backup & Recovery 11 Quick Start Guide Applies to the following editions: Advanced Server Virtual Edition Advanced Server SBS Edition Advanced Workstation Server for Linux Server for Windows Workstation
FileMaker Server 13 FileMaker Server Help 2010-2013 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker,
Monitoring Windows Servers and Applications with GroundWork Monitor Enterprise 6.7 Product Application Guide October 8, 2012 Table of Contents Introduction...3 Definitions and Abbreviations...3 GroundWork
Canto Cumulus 5.5 Workgroup Edition Administrator Guide An administrator s guide to the Canto Cumulus Digital Asset Management System. 290 Division Street, Suite 400 San Francisco, CA 94103 U.S.A. Voice:
Using Delphix Server with Microsoft SQL Server (BETA) Table of Contents Architecture High level components in linking a SQL Server database to Delphix High level components in provisioning a SQL Server
Close Support Service Desk v 3.00 Upgrade Guide I Close Support Service Desk v 3 Upgrade Manual Table of Contents Part I Upgrading from version 2.95 2 1 Prerequisites... 2 2 Potential version... conflicts
NovaBACKUP User Manual NovaStor / May 2014 2014 NovaStor, all rights reserved. All trademarks are the property of their respective owners. Features and specifications are subject to change without notice.
RSA Authentication Manager 8.1 Help Desk Administrator s Guide Revision 1 Contact Information Go to the RSA corporate website for regional Customer Support telephone and fax numbers: www.emc.com/domains/rsa/index.htm
Acronis Backup & Recovery 11.5 Update 2 Installation Guide Applies to the following editions: Advanced Server Server for Windows Virtual Edition Server for Linux Advanced Server SBS Edition Workstation
This video will look the different versions of Active Directory Federation Services. This includes which features are available in each one and which operating system you need in order to use these features.
Yosemite Server Backup User s Guide Part number: First edition: October 2010 Legal and notice information Copyright 2004, 2012 Barracuda Networks, Inc. Under copyright laws, the contents of this document
Cumulus 8.1 Administrator Guide Copyright 2010, Canto GmbH. All rights reserved. Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto, registered in the U.S. and other
Sugar Community Edition User Guide Version 5.2 Copyright Information Version 5.2, 2008 Copyright 2004-2008 SugarCRM Inc. www.sugarcrm.com This document is subject to change without notice 1. License This
Kerio Connect Administrator s Guide Kerio Technologies 2011 Kerio Technologies s.r.o. All rights reserved. This guide provides detailed description on Kerio Connect, version 7.2. All additional modifications
ACTi Central Management System User s Manual Version 1.1.05.06 2012/10/12 Table of Contents 1 Overview 5 Software Architecture... 5 2 Installation 6 Requirements... 6 Operating System... 6 Hardware System
MaaS360 Cloud Extender Installation Guide Copyright 2013 Fiberlink Communications Corporation. All rights reserved. Information in this document is subject to change without notice. The software described
Installation / Backup \ Restore of a Coffalyser.Net server database using SQL management studio This document contains instructions how you can obtain a free copy of Microsoft SQL 2008 R2 and perform the
GFI Backup 2010 Business Edition Getting Started Guide http://www.gfi.com E-mail: firstname.lastname@example.org Information in this document is subject to change without notice. Companies, names, and data used in examples
TOP REASONS TO MOVE TO MICROSOFT EXCHANGE 2010 Prepared By: Sy Computing Services, Inc. What s new in Exchange Server 2010? Exchange Server 2010 contains a host of improvements and a lot of new features,
Parallels Panel Contents About This Document 3 Integration and Automation Capabilities 4 Command-Line Interface (CLI) 8 API RPC Protocol 9 Event Handlers 11 Panel Notifications 13 APS Packages 14 C H A