Pawan K. Bhardwaj
Windows System
Administration
Using Command Line Scripts
How to Cheat at
405_Script_FM.qxd 9/5/06 11:37 AM Page i
Syngress Publishing, Inc., the author(s), and any person or firm involved in the writing, editing, or produc-
tion (collectively “Makers”) of this book (“the Work”) do not guarantee or warrant the results to be
obtained from the Work.
There is no guarantee of any kind, expressed or implied, regarding the Work or its contents.The Work is
sold AS IS and WITHOUT WARRANTY.You may have other legal rights, which vary from state to
state.
In no event will Makers be liable to you for damages, including any loss of profits, lost savings, or other
incidental or consequential damages arising out from the Work or its contents. Because some states do not
allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation
may not apply to you.
You should always use reasonable care, including backup and other appropriate precautions, when working
with computers, networks, data, and files.
Syngress Media®, Syngress®, “Career Advancement Through Skill Enhancement®,”“Ask the Author
UPDATE®,” and “Hack Proofing®,” are registered trademarks of Syngress Publishing, Inc.“Syngress:The
Definition of a Serious Security Library”™, “Mission Critical™,” and “The Only Way to Stop a Hacker is
to Think Like One™” are trademarks of Syngress Publishing, Inc. Brands and product names mentioned
in this book are trademarks or service marks of their respective companies.
KEY SERIAL NUMBER
001 HJIRTCV764
002 PO9873D5FG
003 829KM8NJH2
004 94287PLK49
005 CVPLQ6WQ23
006 VBP965T5T5
007 HJJJ863WD3E
008 2987GVTWMK
009 629MP5SDJT
010 IMWQ295T6T
PUBLISHED BY
Syngress Publishing, Inc.
800 Hingham Street
Rockland, MA 02370
How to Cheat at Windows System Administration Using Command Line Scripts
Copyright © 2006 by Syngress Publishing, Inc. All rights reserved. Except as permitted under the
Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by
any means, or stored in a database or retrieval system, without the prior written permission of the pub-
lisher, with the exception that the program listings may be entered, stored, and executed in a computer
system, but they may not be reproduced for publication.
1 2 3 4 5 6 7 8 9 0
ISBN: 1-59749-105-5
Publisher: Andrew Williams Page Layout and Art: Patricia Lupien
Acquisitions Editor: Gary Byrne Copy Editor:Audrey Doyle
Technical Editor: Kimon Andreou Indexer: Odessa&Cie
Cover Designer: Michael Kavish
Distributed by O’Reilly Media, Inc. in the United States and Canada.
For information on rights, translations, and bulk sales, contact Matt Pedersen, Director of Sales and Rights,
at Syngress Publishing; email matt@syng
ress.com or fax to 781-681-3585.
405_Script_FM.qxd 9/5/06 11:37 AM Page ii
iii
Lead Author
Pawan K. Bhardwaj (MCSE, MCT, Security+, Network+, I-Net+
and A+) is an independent technical trainer and author. He has been
actively involved in Windows administration ever since Windows
NT 3.51 was released. In the past 16 years he has worked at various
system and network support levels for small and medium-sized
companies. Some of his major projects included working for one of
India’s largest newspaper groups and a large e-commerce organiza-
tion in the United States where he had an active involvement in
design and implementation of large-scale LAN and WAN solutions
based on Windows technologies.
Pawan was one of the first 100 in India to attain MCSE certifi-
cation back in 1997. He teaches Windows administration and net-
working classes and also acts as a consultant to training institutions.
He has authored or contributed to more than 12 certification books
by Syngress/McGraw Hill. He also coauthored MCSE 2003 Electives
Exams in a Nutshell (O’Reilly Media, Inc., 2006).
This book is dedicated to the loving memory of my father, Sudershan
Bhardwaj, and my father-in-law, Ghanshyam Pandit, both of whom passed
away during the writing of this book.
—Pawan K. Bhardwaj
Kimon Andreou is IT Portfolio Manager at Royal Caribbean
International in Miami, FL. His expertise is in software develop-
ment, software quality assurance, data warehousing, and data security.
Kimon’s experience includes positions as CTO for Secure Discovery
Solutions, an e-Discovery company; Manager of Support & QA at
S-doc, a software security company; and as Chief Solution Architect
Technical Editor and Reviewer
405_Script_FM.qxd 9/5/06 11:37 AM Page iii
iviv
for SPSS in the Enabling Technology Division. He also has led pro-
jects in Asia, Europe, North America, and South America. Kimon
holds a Bachelor of Science in Business Administration from the
American College of Greece and a Master of Science in
Management Information Systems from Florida International
University.
Kimon wrote Chapter 12.
Brian Barber (MCSE, MCP+I, MCNE, CNE-5, CNE-4, CNA-3,
CNA-GW) is coauthor of Syngress Publishing’s Configuring Exchange
2000 Server (ISBN: 1-928994-25-3), Configuring and Troubleshooting
Windows XP Professional (ISBN: 1-928994-80-6), and two study
guides for the MSCE on Windows Server 2003 track (exams 70-296
[ISBN: 1-932266-57-7] and 70-297 [ISBN: 1-932266-54-2]). He is a
Senior Technology Consultant with Sierra Systems Consultants Inc. in
Ottawa, Canada. He specializes in IT service management and tech-
nical and infrastructure architecture, focusing on systems management,
multiplatform integration, directory services, and messaging. In the
past he has held the positions of Senior Technical Analyst at MetLife
Canada and Senior Technical Coordinator at the LGS Group Inc.
(now a part of IBM Global Services).
Brian wrote Chapter 11.
Dave Kleiman (CAS, CCE, CIFI, CISM, CISSP, ISSAP, ISSMP,
MCSE) has worked in the Information Technology Security sector
since 1990. Currently, he is the owner of SecurityBreach
Response.com. A former Florida Certified Law Enforcement
Officer, he specializes in litigation support, computer forensic inves-
Contributing Authors
405_Script_FM.qxd 9/5/06 11:37 AM Page iv