PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2008 by Ed Wilson
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or
by any means without the written permission of the publisher.
Library of Congress Control Number: 2007941089
Printed and bound in the United States of America.
1 2 3 4 5 6 7 8 9 QWT 3 2 1 0 9 8
Distributed in Canada by H.B. Fenn and Company Ltd.
A CIP catalogue record for this book is available from the British Library.
Microsoft Press books are available through booksellers and distributors worldwide. For further infor-
mation about international editions, contact your local Microsoft Corporation office or contact Microsoft
Press International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress.
Send comments to mspinput@microsoft.com.
Microsoft, Microsoft Press, Active Directory, ActiveX, Excel, Internet Explorer, MSDN, MSN, Outlook,
SQL Server, Visual Basic, Windows, Windows NT, Windows PowerShell, Windows Server, Windows
Vista, and Zune are either registered trademarks or trademarks of Microsoft Corporation in the United
States and/or other countries. Other product and company names mentioned herein may be the
trademarks of their respective owners.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places,
and events depicted herein are fictitious. No association with any real company, organization, product,
domain name, e-mail address, logo, person, place, or event is intended or should be inferred.
7KLVERRNH[SUHVVHVWKHDXWKRU¶VYLHZVDQGRSLQLRQV7KHLQIRUPDWLRQFRQWDLQHGLQWKLVERRNLVSURYLGHG
without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its
resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly
or indirectly by this book.
Acquisitions Editor: Martin DelRe
Developmental Editor: Karen Szall
Project Editor: Denise Bankaitis and Michelle Goodman
Editorial Production: Custom Editorial Productions, Inc.
Technical Reviewer: Bob Hogan; Technical Review services provided by Content Master, a member
of CM Group, Ltd.
Cover: Tom Draper Design
Body Part No. X14-14922
This book is dedicated to Teresa. I am so glad
you decided to share your life with me.
A03D622791.fm Page iii Friday, December 14, 2007 10:52 AM
A03D622791.fm Page iv Friday, December 14, 2007 10:52 AM
v
Contents at a Glance
1 The Shell in Windows PowerShell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Scripting Windows PowerShell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3 Managing Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4 Managing Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5 Managing Shares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6 Managing Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
7 Desktop Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
8 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
9 Configuring Desktop Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10 Managing Post-Deployment Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
11 Managing User Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
12 Troubleshooting Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
13 Managing Domain Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
14 Configuring the Cluster Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
15 Managing Internet Information Services . . . . . . . . . . . . . . . . . . . . . . . . 443
16 Working with the Certificate Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
17 Managing the Terminal Services Service. . . . . . . . . . . . . . . . . . . . . . . . . 509
18 Configuring Network Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
19 Working with Windows Server 2008 Server Core . . . . . . . . . . . . . . . . . 583
A Cmdlet Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
B ActiveX Data Object Provider Names . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
C Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
D Scripting Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
E General Troubleshooting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
A04G622791.fm Page v Friday, December 14, 2007 10:52 AM