PowerShell for Total Beginners - eBook (PDF, ePub, MOBI)
PowerShell for Total Beginners is my custom built, handcrafted, painstakingly curated book and video series designed to get you from total PowerShell newbie to confident and open PowerShell user in as little as four weeks.
Preface
If you can’t do your job without a GUI, you’re at the end of the road.
Learning PowerShell is hard. And it’s OK to admit that.
What to Expect from This Book
What’s Special About This Book
Don’t Wait
Chapter 1: Getting Started and Setting Up
Valid Platforms and Versions
Two Important PowerShell Tools
The PowerShell Integrated Scripting Environment (ISE)
IntelliSense
Getting the ISE Set Up
The Windows PowerShell Console
Running the Console as an Administrator
Setting Up the Windows PowerShell Console
Running and Stopping Commands in the Console
Windows PowerShell Console Caveats
Tab Completion
The Last Word
Chapter 2: The Basics of PowerShell
Some Terminology and Definitions
A Little about Aliases
PowerShell Command Components
Commands
Parameters
Syntax
Types of Parameter Values
Some Parameters are Positional Parameters
Optional Parameters
Mandatory Parameters
Parameter Sets – The Fork In The Road
Common Parameters
Shortcuts
External Commands
Commands Within Commands
Knowing Which Commands to Use and How to Use Them: Getting Help
Looking at Help for a Known Command
Looking for Help With an Idea or Concept
Full, Unrestrained, Painstakingly Detailed Help
A Little Interactive Handholding: Show-Command
Understanding Error Messages
Always Use Protection: Stopping You from Hurting Yourself
The Last Word
Chapter 3: The PowerShell Pipeline
Introducing the Pipeline
Piping to the Screen and to Files
To the Screen: Out-Host
To Files: Out-File
To Printers: Out-Printer
Importing and Exporting Data for PowerShell to Work With
Importing from Comma-Separated Values (CSV) Files
Exporting to Comma-Separated Values (CSV) Files
Converting Content
The Last Word
Chapter 4: PowerShell Providers, Modules, and Snap-ins
Introducing Providers
How Providers Work
Provider Capabilities and Drives
Items
Differences in Providers Matter
A Provider Example: The Registry
Introducing Modules and Snap-ins
Modules
Snap-ins
About Management Shells
Your Profile: Your Favorite Snap-Ins and Modules, Automatically Loaded
The Last Word
Chapter 5: The Complete Beginner’s Guide to Objects
What is an Object?
Properties and Methods
Objects and the Pipeline
Inspecting an Object’s Properties and Methods
Manipulating Objects
Limiting or Selecting
Sorting
Remembering What Kinds of Objects are in the Pipeline
The Last Word
Chapter 6: Filtering and Limiting
Introducing Where-Object
The Syntax for Where-Object
Using the Where-Object Goods
Getting Lists and Filtering on Them
Filtering, in a Pragmatic Sense
Another Example of Objects and Filtering
Further Exploration
The Last Word
Chapter 7: Creating Simple Scripts
Introducing Scripts in PowerShell
Making Scripts Useful, Phase 1: Variables
Making Scripts Useful, Phase 2: If/Then, Do-While, and ForEach
The If/Then Construct
Do While Constructs
The ForEach Construct
Putting It All Together: Scripts to Accomplish Something Useful
Method 1
Method 2
A Simple Backup Strategy for Smaller Environment: Exporting Mailboxes
Clearing the Requests
The Last Word
Chapter 8: More Work with Objects
Comparing Two Objects
Looking at Compare-Object
Another Example
Selecting Objects
Selecting a Certain Number of Objects
Selecting Certain Properties
Grouping Objects with Common Characteristics
Hash Tables
PowerShell in the Real World: Grouping and Comparing Objects
The Last Word
Chapter 9: To The Many, To The Few - PowerShell Remoting
Introducing Remoting
How Remoting Works
Enabling PowerShell Remoting
Remoting to One Computer at a Time
Remoting to Many Computers at a Time
Specifying a Script File Instead of a Command
Specifying a Separate List of Computers
The Caveats When Using Remote Commands
Serialization and Deserialization Side Effects
Remoting with Efficiency in Mind
Remoting Needs Some Permission Sometimes
The Last Word
Chapter 10: Useful PowerShell Tools
Dell PowerGUI
SAPIEN Technologies PowerShell Studio 2015
Amazon AWS Tools for Windows PowerShell
Microsoft Script Browser for Windows PowerShell ISE
Adam Driscoll’s PowerShell Tools for Visual Studio
Microsoft Windows PowerShell Web Access, via Control Panel
PowerShell Training via the Microsoft Virtual Academy
Master-PowerShell, an ebook from Dr. Tobias Weltner
VMware vSphere PowerCLI
The Last Word
Chapter 11: Using PowerShell to Manage Office 365
Create a Script to Open a PowerShell Session to Office 365 in One Click
Assign Rights to Mailboxes
Converting Regular Mailboxes to Shared Mailboxes
Obtaining Last Logon Times for Office 365 Accounts
Onboarding a List of Multiple New Users to Your Office 365 Tenant
Lock Down and Configure Sharing on a SharePoint Online Tenant
Examining and Auditing Who Has External Access to a SharePoint Online Site
Add and Remove People from Mailing Lists (Distribution Groups)
Performing a Mass Password Change
Place All Mailboxes on Litigation Hold
The Last Word
Chapter 12: Wrapping Up - Performing Five Common Administrative Tasks using Windows PowerShell
Adding Users
Deleting Dangerous or Objectionable Content from Exchange Mailboxes
Elegantly Handling Departed Employees and Their Distribution List Memberships
Create a New Comma Separated Values (.CSV) File and Populate It With Data
Easily Connect to Exchange Online or Office 365 from Your Hybrid Deployment
Appendix X: Quick Cheat Sheet of PowerShell Verbs