PowerShell for SharePoint 2010 How-To
Steven Mann
800 East 96th Street, Indianapolis, Indiana 46240 USA
PowerShell for SharePoint 2010 How-To
Copyright 2011 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
ISBN-10: 0-672-33559-X
ISBN-13: 978-0-672-33559-4
Library of Congress Cataloging-in-Publication Data
Mann, Steve, 1950
PowerShell for SharePoint 2010 : how to / Steven Mann.
p. cm.
ISBN 978-0-672-33559-4
1. Intranets (Computer networks)--Management--Miscellanea. 2. Microsoft
SharePoint (Electronic resource)--Miscellanea. 3. Groupware (Computer
software)--Miscellanea. 4. Windows PowerShell (Computer program
language)--Miscellanea. 5. Microsoft Windows (Computer file)--Miscellanea.
I. Title.
TK5105.875.I6M365 2011
006.7'8dc23
2011020669
Printed in the United States of America
First Printing: June 2011
Editor-in-Chief
Greg Wiegand
Executive Editor
Neil Rowe
Development Editor
Mark Renfrow
Managing Editor
Kristy Hart
Project Editor
Andy Beaster
Copy Editor
Bart Reed
Indexer
Tim Wright
Proofreader
Debbie Williams
Technical Editor
J. Boyd Nolan
Team Coordinator
Cindy Teeters
Book Designer
Gary Adair
Composition
Gloria Schurick
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Pearson cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The author 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.
Bulk Sales
Pearson offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact:
U.S. Corporate and Government Sales
1-800-382-3419
For sales outside of the U.S., please contact:
International Sales
+1-317-581-3793
Dedication
In loving memory of my grandfather, Max Winitz, who always taught me to do my best and to be a man.
About the Author
Steve Mann was born and raised in Philadelphia, Pennsylvania, where he still resides today. He is an Enterprise Applications Engineer for Morgan Lewis and has more than 17 years of professional experience. Steve was previously a Principal Architect for RDA Corporation, where he worked for more than 13 years.
For the past 8 years, Steve has primarily focused on collaboration and business intelligence solutions using Microsoft technologies. He managed the internal BI Practice Group at RDA for several years. He was also heavily involved within RDAs Collaboration/Search Practice Group.
Steve has authored and coauthored several books related to the subject of SharePoint Server 2010. His blog site can be found at www.SteveTheManMann.com.
Acknowledgments
Thanks to Sams Publishing and Neil Rowe for making this book a reality and for giving me the opportunity to share my ideas and solutions.
Tell Us What You Think!
As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what were doing right, what we could do better, what areas youd like to see us publish in, and any other words of wisdom youre willing to pass our way.
I welcome your comments. You can email or write me directly to let me know what you did or didnt like about this bookas well as what we can do to make our books stronger.
Please note that I cannot help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message.
When you write, please be sure to include this books title and author as well as your name and phone or fax number. I will carefully review your comments and share them with the author and editors who worked on the book.
Email:
Mail: Neil Rowe
Executive Editor
Sams Publishing
201 West 103rd Street
Indianapolis, IN 46290 US
Reader Services
Visit our website and register this book at informit.com/register for convenient access to any updates, downloads, or errata that might be available for this book.
Introduction
Overview of This Book
PowerShell is becoming the de facto administration tool for Microsoft Server products. The ability to script out reusable steps and code makes life easier for administrators, developers, and managers alike. With the latest release of Microsoft SharePoint Server 2010, PowerShell is the recommended administration tool. The previous stsadm console application is still available for backward compatibility but will soon be deprecated. Therefore, it is essential to understand the available cmdlets within SharePoint 2010.
This book is designed to provide a great reference of the SharePoint cmdlets across all areas and features within the product. The scenarios covered can be used to build out simple to complex scripts using the syntax and examples found within this books chapters.
How to Benefit from This Book
This book provides a brief overview of how to get started with PowerShell in a SharePoint environment. It is not, however, a tutorial on PowerShell scripting itself. Use this book as a guide for performing repeated tasks or scripting out steps that need to be replicated across your SharePoint environments (development, staging, production, and so on). Whether it is for server management (including farm and web application administration), development, or the new service applications, this book describes the common cmdlets and SharePoint functionality available through PowerShell.
There have been changes within the SharePoint 2010 cmdlets during various releases (for example, beta, release candidates, and product releases). Many examples provided on the Internet use the old cmdlets and/or do not provide the appropriate parameters or types. In addition, some of the documentation on the cmdlets, settings, and configurations available on the Internet is incorrect. You can rest assured that all of the sample command lines in this book have been tested and confirmed to be as accurate as possible.
You can access the code examples used in this book by registering on the books website at informit.com/register. Go to this URL, sign in, and enter the ISBN to register (free site registration required). After you register, look on your Account page, under Registered Products, for a link to Access Bonus Content.