All rights reserved. No part of this lab manual may be reproduced or transmitted in any form or by any means without the prior written permission of the publisher.
Every effort has been made to make this manual as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
Wed like to hear from you! If you have any comments about how we could improve the quality of this book, please dont hesitate to contact us by visiting www.mvpdays.com or sending an email to feedback@mvpdays.com.
Foreword Ed Wilson The Scripting Guy
There are many cool things about Windows PowerShell. For me three of the most awesome things are the following:
1. If you dont like the way Windows PowerShell does things, you can change it.
2. If Windows PowerShell cant do something you need, you can add it.
3. The Windows PowerShell community is super dedicated, and will help you do both one and two.
Now, to be honest at times, it is necessary to write hundreds and hundreds of lines of arcane code, to dive into the deepest and darkest mysteries of programing, and even to learn about things like APIs, Constructors, Events, threading, ACLs, DACLs, CACLs and maybe even Tetradactylies. Then again, most of the time it is not. In fact, it has been years and years since I wrote a hundreds and hundreds of lines of arcane code.
It is almost as if the Windows PowerShell team deliberately tried to make Windows PowerShell easy to use and easy to learn. Hmm I wonder if that approach would ever catch on? Anyway, there used to be an old saw: Ease of use is directly opposed to program capability. Or, in other words, if it is easy to use, it probably is not all that powerful. Well, PowerShell changes that dramatically.
And yet, Windows PowerShell is also deceptively easy to use. One can go from Get-Service and Get-Process or even Get-Date to some pretty complicated stuff in like one line of code.
This is why item number three is so important. The authors of this book: Dave, Sean, Thomas and Allan are all Windows PowerShell experts, and have even been recognized by Microsoft as community leaders. So, this means not only do they know their stuff, but they are also great at sharing that knowledge with the community. Sean Kearney is even an Honorary Scripting Guy a very elite group indeed!
One of the great way that MVPs share their knowledge and experience is via MVP Days a traveling road show that was started by Dave and Cristal Kawula. This is a very well run event, and I have had the opportunity to speak at two of the events it is cool, and it is fun.
So grab this book, get it autographed, and learn how to master some awesome PowerShell tricks. It is cool.
Ed Wilson
Microsoft Scripting Guy
@ScriptingGuys
Acknowledgements
From Dave
Cristal you are my rock and my source of inspiration. For the past 20 + years you have been there with me every step of the way. Not only are you the BEST Wife in the world you are my partner in crime. Christian, Trinity, Keira, Serena, Mickaila and Mackenzie, you kids are so patient with your dear old dad when he locks himself away in the office for yet another book. Taking the time to watch you grow in life, sports, and become little leaders of this new world is incredible to watch.
Thank you, Mom and Dad (Frank and Audry). You got me started in this crazy IT world when I was so young. Your efforts helping me review this book are truly appreciated.
Last but not least, the MVPDays volunteers, you have donated your time and expertise and helped us run the event in over 15 cities across North America. Here is to the next 15 events and maybe we will expand to a worldwide roadshow someday.
About the Author s
Dave Kawula - MVP
Dave is a Microsoft Most Valuable Professional (MVP) with over 20 years of experience in the IT industry. His background includes data communications networks within multiserver environments, and he has led architecture teams for virtualization, System Center, Exchange, Active Directory, and Internet gateways. Very active within the Microsoft technical and consulting teams, Dave has provided deep-dive technical knowledge and subject matter expertise on various System Center and operating system topics.
Dave is well-known in the community as an evangelist for Microsoft, 1E, and Veeam technologies. Locating Dave is easy as he speaks at several conferences and sessions each year, including TechEd, Ignite, MVP Days Community Roadshow, and VeeamOn.
As the founder and Managing Principal Consultant at TriCon Elite Consulting, Dave is a leading technology expert for both local customers and large international enterprises, providing optimal guidance and methodologies to achieve and maintain an efficient infrastructure.
BLOG: www.checkyourlogs.net
Twitter: @DaveKawula
Sean Kearney - MVP
$PowerShellMVPBio=@'
"A long time ago in a Cmdlet far far away... there was this guy, who sang about PowerShell"
Here is a person who genuinely loves his job and smiles he gets paid to do what he loves, It's PowerShell MVP Sean Kearney
Presently working for a Microsoft Gold Partner in Ottawa as a Senior Solutions Architect, he lives each and every day for an opportunity to show someone and easier and more consistent way to do their job with Windows
PowerShell.
BLOG: http://www.energizedtech.com/
Twitter: @energizedtech
Thomas Rayner - MVP
Thomas Rayner is an information technology, entrepreneurship and leadership enthusiast with a penchant for Microsoft tools and products. Thomas is a proud graduate of several programs at NAIT, an institution that he remains actively connected to. He works on the DevOps and Automation team at PCL Construction.
BLOG: http://workingsysadmin.com
Twitter: @mrthomasrayner
Allan Rafuse Future MVP
Allan has worked as a senior member of the Windows and VMWare Platform Department at Swedbank. He took part in the architecture and implementation of multiple datacenters in several countries. He is responsible for the roadmap and lifecycle of the Windows Server Environment, including the development of ITIL processes of global server OSD, configuration, and performance.
He is an expert at scripting solutions and has an uncanny ability to reduce complexity and maximize the functionality of PowerShell. Allan has recently rejoined the TriCon Elite Consulting team again as a Principal Consultant.
BLOG: http://www.checkyourlogs.net
Twitter: @allanrafuse
Ed Wilson The Scripting Guy
Ed Wilson is a well-known scripting expert. He is a Microsoft Certified Trainer who has delivered a popular Windows PowerShell workshop to Microsoft Premier customers worldwide. Ed has written six books on Microsoft Windows scripting for Microsoft Press. His three Windows PowerShell books are Windows PowerShell 2.0 Best Practices, Windows PowerShell Scripting Guide, and Microsoft Windows PowerShell Step by Step. He has also written or contributed to almost a dozen other books. Ed holds more than 20 industry certifications, including Microsoft Certified Systems Engineer (MCSE) and Certified Information Systems Security Professional (CISSP). Before coming to work for Microsoft, Ed was a senior consultant for a Microsoft Gold Certified Partner where he specialized in Active Directory design and Exchange Server implementation. Ed and the Scripting Wife Teresa live in South Carolina. In his spare time, he enjoys woodworking, underwater photography, and scuba diving. And tea.