www.it-ebooks.info Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook 50 advanced recipes for administrators and IT Pros to master Microsoft SharePoint 2010 and Microsoft PowerShell 2.0 automation Yaroslav Pentsarskyy BIRMINGHAM - MUMBAI www.it-ebooks.info Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook Copyright © 2011 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: November 2011 Production Reference: 1071111 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84968-410-1 www.packtpub.com Cover Image by John Green ([email protected]) www.it-ebooks.info Credits Author Project Coordinator Yaroslav Pentsarskyy Kushal Bhardwaj Reviewers Proofreader Muhammad A. Piracha Joel T. Johnson Ravikanth C Indexer Acquisition Editor Monica Ajmera Mehta Stephanie Moss Production Coordinator Development Editor Melwyn D'sa Maitreya Bhakal Cover Work Technical Editor Melwyn D'sa Manasi Poonthottam www.it-ebooks.info About the Author Yaroslav Pentsarskyy has been involved in SharePoint solution architecture and implementation since 2003. He has been a Microsoft MVP since 2009 and keeps in close contact with the SharePoint product team. Yaroslav frequently presents at technical events worldwide as well as online. You can always find a fresh bit of SharePoint information on his blog: http://www.sharemuch.com. To learn everything Yaroslav knows about SharePoint, check out his two new books Top 60 Custom Solutions built on SharePoint 2010 and SharePoint 2010 branding in practice. www.it-ebooks.info About the Reviewers Muhammad A. Piracha is a senior Software Engineer at Bamboo Solutions Corporation, which is based in Reston, Virginia. Bamboo Solutions is a leading provider of software solutions for the Microsoft SharePoint platform. Muhammad has over 15 years of experience in building document management software applications using various Microsoft products. He has experience in a variety of capacities, including architecting, designing, and developing software for SharePoint technologies since its release in 2003. When he is not on a computer writing code, he enjoys spending time with his family and outdoor activities. Ravikanth C has more than 10 years of experience in the IT industry. In the beginning of his career, he worked at Wipro Infotech managing Windows, Solaris servers, and Cisco network equipment. He currently works at Dell Inc. as a lead engineer in the SharePoint solutions group. As a part of his work, he has authored several whitepapers on MOSS 2007 and SharePoint 2010 that provide guidance around infrastructure elements of a SharePoint deployment. His work also involves performance testing and sizing of SharePoint workloads on Dell servers and storage. Ravikanth is passionate about automation and outside of work he writes regularly on his blog, http://www.ravichaganti.com/blog, about topics related to Windows PowerShell, Microsoft SharePoint, and Windows Server virtualization. In 2010, Ravikanth received Microsoft's Most Valuable Professional (MVP) award in Windows PowerShell. You can also hear him speak regularly at BITPro (http://bitpro.in) user group meetings and other in-person events at Bangalore, India. www.it-ebooks.info www.PacktPub.com Support files, eBooks, discount offers, and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@ packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? f Fully searchable across every book published by Packt f Copy and paste, print and bookmark content f On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Instant Updates on New Packt Books Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page. www.it-ebooks.info Table of Contents Preface 1 Chapter 1: PowerShell Scripting Methods and Creating Custom Commands 7 Introduction 7 Setting up your Virtual Machine and running a test script 8 Authoring, debugging, and executing script accessing farm settings with PowerGUI and PowerShell ISE 10 Accessing advanced SharePoint 2010 functionality with external libraries 17 Creating a custom PowerShell command (CmdLet) 22 Creating a custom PowerShell Snap-In 26 Chapter 2: Enterprise Content Deployment and Provisioning Using PowerShell 33 Introduction 33 Provisioning site hierarchy during solution deployment 34 Installing features on the site and managing existing site features 39 Creating permission levels and security groups that use them 46 Managing site templates and their availability on sites 50 Associating features to existing site templates 55 Managing SharePoint workflow association using PowerShell 60 Configuring site themes and user interface artifacts 65 Chapter 3: Performing Advanced List and Content Operations in SharePoint using PowerShell 73 Introduction 73 Creating lists of custom structures 74 Setting SharePoint list item validation with PowerShell 78 Setting list item security 84 www.it-ebooks.info Table of Contents Setting list relationships 89 Customizing list views 94 Managing the use of content types in lists 99 Chapter 4: Managing External Data in SharePoint and Business Connectivity Services using PowerShell 105 Introduction 105 Importing a custom BCS model to SharePoint 106 Exporting SharePoint BCS model and schema 111 Creating instances of external lists with PowerShell 116 Managing permissions on an external list 121 Throttling items returned with external lists 127 Chapter 5: Managing SharePoint 2010 Metadata and Social Features Using PowerShell 133 Introduction 133 Creating new user profiles 134 Adding and configuring new profile properties 140 Bulk provisioning data into user profile properties 145 Creating, importing, and exporting managed metadata taxonomy terms 151 Enabling social ratings on lists and libraries 157 Bulk tagging content and deleting tags in SharePoint 162 Chapter 6: Managing SharePoint Search and FAST Search with PowerShell 169 Introduction 169 Configuring search query suggestions in your search center 170 Configuring search best bets 175 Configuring visual best bets 180 Configuring search audience targeting 186 Configuring search web parts automatically with PowerShell 191 Chapter 7: Managing SharePoint Site Content in Bulk using PowerShell 199 Introduction 199 Creating basic and complex content types 200 Creating and configuring document sets 205 Creating and editing publishing pages with PowerShell 211 Provisioning web parts in bulk on to SharePoint pages 217 Configuring web parts in bulk with PowerShell 222 Provisioning list rollups using Powershell 227 Chapter 8: Managing Documents and Records in SharePoint with PowerShell 233 ii www.it-ebooks.info Table of Contents Introduction 233 Provisioning documents and records center with PowerShell 234 Configuring record routing 240 Configuring a common record expiration policy 246 Creating a custom expiration policy for the record 252 Configuring content hub for content types used in records center 257 Chapter 9: Administrating Web Application and Server Administration in SharePoint with PowerShell 263 Introduction 263 Configuring web application settings 264 Parsing SharePoint logs using PowerShell 271 Managing web application throttling settings 276 Configuring sandbox solution policies 282 Managing sandbox solutions in SharePoint site collections 286 Index 293 iii www.it-ebooks.info
Description: