PowerShell 3.0 Advanced Administration Handbook A fast-paced PowerShell guide with real-world scenarios and detailed solutions Sherif Talaat Haijun Fu BIRMINGHAM - MUMBAI PowerShell 3.0 Advanced Administration Handbook Copyright © 2013 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 authors, 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: April 2013 Production Reference: 1150413 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84968-642-6 www.packtpub.com Cover Image by Siddhart Ravishankar ([email protected]) Credits Authors Project Coordinator Sherif Talaat Arshad Sopariwala Haijun Fu Proofreaders Amy Guest Reviewers Mark Andrews Chris Smith Karim CAMMOUN Indexer Tong Young Monica Ajmera Mehta Acquisition Editor Graphics Rukhsana Khambatta Valentina Dsilva Lead Technical Editor Production Coordinator Dayan Hyames Shantanu Zagade Technical Editors Cover Work Sharvari Baet Shantanu Zagade Prasad Dalvi Nitee Shetty Copy Editors Brandt D'Mello Insiya Morbiwala Aditya Nair Alfida Paiva About the Authors Sherif Talaat is a young computer science addict. He is MCSA, MCSE, MCTS, and MCITP certified. He has been working in the ICT industry since 2005. He used to work on Microsoft core infrastructure platforms and solutions with main focus on IT process automation and scripting techniques. He is one of the early adopters of Windows PowerShell in the region called MEA—Middle East and Africa. He speaks about Windows PowerShell in technical events and user groups' gatherings; he is the founder of the "Egypt PowerShell User Group" (http://powershellgroup.org/egypt), and is the author behind the first and only Arabic PowerShell blog (http://arabianpowershell.wordpress.com). He has been awarded the Microsoft Most Valuable Professional (MVP) award for PowerShell five times in row since 2009. You can also catch him at sheriftalaat.com. Acknowledgement I would like to take the chance to dedicate this book to the soul of my dad and to thank my mom for her love, encouragement, and prayers. To my sisters Shereen and Dalia, and my brother Amr, thank you so much for the usual support, feedback, guidance, and for being proud of me. To Israa, the best wife in the world, thanks for your love, support, and patience during the long days and nights I have spent writing this book. I could not have done this without you. To my dear son Yahia, you were the hidden source of inspiration to complete this book. Keep it up my son, I need this again in future engagements. To Prof. Ahmed Bahaa, Refaat Issa, and Sherif Tawfik, thanks for everything you taught me for building the unique, professional, persistent, and challenging person inside me. I really can't thank you enough for the support, advice, trust, and belief you had in me. Last but not the least, thank you Packt Publishing for giving me the chance to write this book. I'd also thank every team member who contributed to this project. Rukhsana, Arshad, Dayan, the external reviewers, and the other guys whom I didn't meet—your contributions were invaluable and this book wouldn't be what it is without you. Haijun Fu is a computer programmer and an author living in China. He was educated at the Lanzhou University. He has been a Windows PowerShell Microsoft Most Valuable Professional (MVP) since 2011. With a strong focus on PowerShell, cloud computing, the next generation of Internet security, Internet technology development, software testing, and database design, he has been writing many articles in order to share his experience with others on his blog. He has over 7 years of experience in software development and system architecture design. He is skilled especially at systems analysis, architecture design, and software project management. In his spare time, he likes reading and writing. He is the author of two technical books called Windows PowerShell 2.0 Application Programming Best, Practices Publishing House of Electronics Industry in Mainland China and 350 PowerShell Utilize Example: Windows Automation Technology Manual in Taiwan. He can be found on the Web at fuhaijun.com and on Twitter as @fuhj02. You can also reach him by e-mail at [email protected]. Acknowledgement First and foremost, I'd like to thank my family who have always been a source of inspiration and encouragement. Without their support, who knows where I'd be. I am very thankful to my love, Ruby Liu, who has always stood by me, helped me at all times, and has even smilingly got me cups of tea during my sleepless nights of writing! Writing a book is an interesting journey. Now that it's completed, looking back over the last several months I'm amazed at how lucky I've been to come in contact with so many terrific people. I would also like to express my gratitude to my friend and co-author of this book, Sherif Talaat, for giving me so many useful suggestions on this book. I was fortunate to have three great guys as reviewers for my book, Mark Andrews, Karim CAMMOUN, and Tong Young. They spent countless hours providing feedback and examples, researching specific content, offering lots of encouragement, and engaging with me in great discussions about PowerShell. Thanks to the editorial and project team at Packt Publishing for giving me the opportunity to write this book, and also being patient and understanding through the process of writes, re-writes, technical edits. So a really big thanks goes to them, especially Rukhsana, Dayan, Arshad, and many more. The team at Packt Publishing, it was an honor and privilege working with you. Last but not the least, I would like to thank my friends who helped me directly or indirectly by giving me moral support. About the Reviewers Mark Andrews has had a varied career in technology. Over the last 18 years he has worked in several departments ranging from customer service to quality assurance. Throughout all of these positions, the responsibility of configuration management and build management has always fallen either to him personally or to one of the groups that he managed; because of his "keeping a hand in" management style, he has been involved closely with the scripting and automation framework for this area. Creating scripted frameworks that intercommunicate across machines, operating systems or domain boundaries is a passion for him. Karim CAMMOUN is an IT consultant based in Ecublens, Switzerland, and has been working on Microsoft products for the past 20 years. With a strong expertise on Microsoft server products, he is a key player in migration projects, analyzing customer needs, and designing and deploying AD, Exchange, Lync, and Windows. Besides, he also develops in C++, PowerShell, VBscript, and VBA. Tong Young has been working in the IT industry since 2000, focusing on Microsoft Windows Server, Exchange, SQL, SCCM, and SCOM. He is a PowerShell enthusiast who uses PowerShell every day to automate tasks and add value to everyday tasks. He is currently working at yellowpages.com. 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. TM 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? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • 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.
Description: