E-Book, Englisch, 481 Seiten
Bhardwaj How to Cheat at Windows System Administration Using Command Line Scripts
1. Auflage 2006
ISBN: 978-0-08-050826-9
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: 6 - ePub Watermark
E-Book, Englisch, 481 Seiten
ISBN: 978-0-08-050826-9
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: 6 - ePub Watermark
How to Cheat at Windows Systems Administrators using Command line scripts teaches system administrators hundreds of powerful, time-saving tips for automating daily system administration tasks using Windows command line scripts.
With every new version of Windows, Microsoft is trying to ease the administration jobs by adding more and more layers of graphical user interface (GUI) or configuration wizards (dialog boxes). While these 'wizards' are interactive and make the administrator's job easier, they are not always the most convenient and efficient way to accomplish the everyday administration tasks. These wizards are time consuming and, at times, may seem a bit confusing. The purpose of the book is to teach administrators how to use command-line scripts to complete everyday administration jobs, solve recurring network problems and at the same time improve their efficiency.
*Provides system administrators with hundreds of tips, tricks, and scripts to complete administration tasks more quickly and efficiently.
*No direct competition for a core tool for Windows administrators.
*Builds on success of other books in the series including How to Cheat at Managing Windows Small Business Server 2003 and How to Cheat at Managing Microsoft Operations Manager 2005.
Autoren/Hrsg.
Weitere Infos & Material
1;Front Cover;1
2;How to Cheat at Windows System Administration: Using Command Line Scripts;2
3;Copyright Page;3
4;Contents;8
5;Introduction;16
6;Part I: Getting Started with Command Line;20
6.1;Chapter 1. Basics of the Command Line;22
6.1.1;Introduction;23
6.1.2;Basics of the Windows Command Shell;23
6.1.3;Starting the Windows Command Shell;24
6.1.4;Internal Commands for the Command Shell;32
6.1.5;Command History;36
6.1.6;Accessing the Windows Command Reference;38
6.1.7;Installing Windows Support Tools;39
6.1.8;Summary;42
6.2;Chapter 2. Using Batch Files;44
6.2.1;Introduction;45
6.2.2;Working Safely with the Command Line;45
6.2.3;Configuring the Command Path;47
6.2.4;Using Command Redirection;52
6.2.5;Using Groups of Commands;56
6.2.6;Creating Batch Files;57
6.2.7;Summary;74
6.3;Chapter 3. Managing Scheduled Tasks;76
6.3.1;Introduction;77
6.3.2;Scheduling Tasks;77
6.3.3;The Task Scheduler Service;78
6.3.4;Managing Tasks Using the Task Scheduler;83
6.3.5;The schtasks Command-Line Utility;94
6.3.6;Managing Tasks with schtasks;105
6.3.7;Summary;113
7;Part II: Basic Windows Administration;114
7.1;Chapter 4. Managing Files and Directories;116
7.1.1;Introduction;117
7.1.2;Using Wildcards in Commands;117
7.1.3;File and Folder Attributes;118
7.1.4;Basic File and Folder Operations;120
7.1.5;Duplicating and Comparing Disks;144
7.1.6;Directory-Specific Commands;148
7.1.7;Summary;153
7.2;Chapter 5. Maintaining Hard Disks;154
7.2.1;Introduction;155
7.2.2;Physical and Logical Disks;155
7.2.3;Understanding Basic and Dynamic Disks;155
7.2.4;Supported File Systems;159
7.2.5;Converting File Systems;164
7.2.6;Summary;189
7.3;Chapter 6. Managing Hard Disks with the Diskpart Utility;190
7.3.1;Introduction;191
7.3.2;The Diskpart Utility;191
7.3.3;Diskpart Commands;193
7.3.4;Scripting with Diskpart;210
7.3.5;Obtaining Volume Information;213
7.3.6;Managing Dynamic Volumes;216
7.3.7;Managing Fault-Tolerant Volumes;217
7.3.8;Summary;220
8;Part III: Managing Windows Systems and Printers;222
8.1;Chapter 7. System Services, Drivers, and the Registry;224
8.1.1;Introduction;225
8.1.2;Obtaining System Information;225
8.1.3;Shutting Down and Restarting the System;235
8.1.4;Managing System Services;240
8.1.5;Obtaining Driver Information;249
8.1.6;Managing the Windows Registry;251
8.1.7;Summary;259
8.2;Chapter 8. Monitoring System Events, Processes, and Performance;260
8.2.1;Introduction;261
8.2.2;Managing Event Logs from the Command Line;261
8.2.3;Creating New Events;262
8.2.4;Working with Event Triggers;263
8.2.5;Viewing Logged Events;268
8.2.6;Monitoring Application Processes and Tasks;273
8.2.7;Using Filters with the TaskList and TaskKill Commands;282
8.2.8;Working with System Performance;284
8.2.9;Extracting Performance Counters from Existing Logs;289
8.2.10;Summary;291
8.3;Chapter 9. Managing Printing Services;292
8.3.1;Introduction;293
8.3.2;Working with Printer Commands;293
8.3.3;Installing a Local Printer;294
8.3.4;Configuring and Renaming Printers;299
8.3.5;Managing Printer Drivers;309
8.3.6;Creating and Configuring TCP/IP Printer Ports;313
8.3.7;Managing Print Queues and Print Jobs;317
8.3.8;Summary;322
9;Part IV: Working with Active Directory;324
9.1;Chapter 10. Overview of Directory Services Commands;326
9.1.1;Introduction;327
9.1.2;Getting Started with DS Commands;327
9.1.3;Types of Objects for DS Commands;328
9.1.4;Querying the Directory Database with DSQuery;330
9.1.5;Adding New Objects with DSAdd;340
9.1.6;Displaying Object Properties with DSGet;348
9.1.7;Modifying Objects with DSMod;356
9.1.8;Moving and Renaming Objects with DSMove;360
9.1.9;Deleting Directory Objects with DSRm;361
9.1.10;Summary;363
9.2;Chapter 11. Managing Active Directory Users, Groups, and Computers;364
9.2.1;Introduction;365
9.2.2;Managing User Accounts;365
9.2.3;Managing Group Accounts;378
9.2.4;Managing Computer Accounts;384
9.2.5;Managing Domain Controller Accounts;389
9.2.6;Summary;393
10;Part V: Windows Networking;394
10.1;Chapter 12. Basic TCP/IP Networking Commands;396
10.1.1;Introduction;397
10.1.2;Overview of the Net Commands;397
10.1.3;Starting and Stopping TCP/IP Services;399
10.1.4;Troubleshooting Commands for TCP/IP;404
10.1.5;Commands for Remote Computers;423
10.1.6;Summary;429
10.2;Chapter 13. Administering Network Services;430
10.2.1;Introduction;431
10.2.2;Overview of the NETSH Commands;431
10.2.3;NETSH Commands for Troubleshooting;436
10.2.4;Managing Interfaces with NETSH;441
10.2.5;Managing Automatic Addressing Using DHCP Services;453
10.2.6;NETSH Commands for AAAA;458
10.2.7;Summary;461
11;Appendix A MS-DOS Commands Not Supported in Windows XP and Windows 2003;462
12;Introduction;462
13;MS-DOS Commands Not Supported in Windows XP/2003 32-Bit Operating Systems;462
14;MS-DOS Commands Not Supported in Windows XP/2003 64-Bit Operating Systems;469
15;Index;476
Introduction
Pawan Bhardwaj, MCSE, MCT, Security+, Network+, A + Welcome to How to Cheat at Windows System Administration Using Command-Line Scripts. This book is designed to help you learn the power of Windows command shell. There was a time in the history of computers when there was no graphical user interface (GUI), and every small and big task was performed using the commands and batch files. With every new version of Windows, Microsoft is trying to ease administrators’ jobs by adding more and more layers of GUI or configuration wizards (dialog boxes). Although these “wizards” are interactive and make the administrator’s job easier, they are not always the most convenient and efficient way to accomplish the everyday administration tasks. These wizards are time-consuming and, at times, may seem a bit confusing. There is certainly a way to avoid these wizards and still accomplish a given task using the command-line utilities included with the operating system. Consider a situation where you wish to add a user to the Active Directory using the Windows wizards or the GUI, assign him/her appropriate permissions to access certain resources, and restrict access to others. It would take roughly one hour to complete the job. By using command line the same task could be done in about half the time. That not only saves you time but also increases your productivity as an administrator. Although the importance of Windows GUIs should not be underrated, the command-line tools have their own importance and utility when it comes to increasing efficiency, boosting effectiveness, and saving time. Command-line tools are both problem solvers as well as time-savers. Not many administrators explore the usefulness of these tools. The purpose of this book is to let administrators know how to utilize these command-line tools to complete everyday administrative jobs, solve recurring network problems, and improve their efficiency. This book contains a total of 13 chapters, divided into five different parts. The first part deals with the basics of Windows command shell, batch files, and scheduled tasks. The second part of the book deals with basic Windows system administration, which consists of managing files and hard disks. The third part of the book covers system services, event logs, performance, and printing services. In the fourth part of the book, we cover Active Directory services. The fifth part of the book deals with managing networking services in a Windows Server 2003 environment. Your journey starts in Chapter 1 with the basics of the Windows command shell. You will learn how to access the command shell and how to customize its properties. You will learn that the command shell’s properties can be modified in several different ways to suit your needs. Installing the support tools included with the Windows Server 2003 setup CD Windows is also covered in this chapter. You will also learn how to access the Windows A-Z Command Reference available in the Help and Support Center. In Chapter 2 we explain how to work safely with the command line using a nonadministrative account. While working with the command shell, you sometimes need to specify a path where commands or batch files are located. You will learn how to change or modify the command path by modifying the environment variable either from the command prompt or from the System Properties dialog box. This chapter also explains how to change command input and output from the standard keyboard and the command shell window, respectively, and how to handle errors generated by commands. Moving ahead, we will discuss the concept of creating simple batch files. You will learn about commonly used commands in batch files and how to use each command inside a batch file. In Chapter 3, we discuss the task scheduler service, the Scheduled Tasks GUI, and the schtasks command-line utility. If the task scheduler service is not running, you will not be able to schedule any script or application to run automatically. The Scheduled Tasks wizard is a perfect tool for scheduling tasks to run at predetermined schedules, but you can also use the schtasks utility to perform the same tasks. This utility replaces the older AT command, which is still supported in Windows XP and Windows Server 2003. You will learn to use different subcommands of the schtasks utility to create, change, delete, query, run, or end a task. schtasks is considered to be one of the most complex command sets in Windows. In Chapter 4, we discuss some of the very common commands used to manage and maintain files, folders, and floppy disks. Having in-depth knowledge of these commands, their syntax, and their use is a great help when you want to use them in batch files or scripts to simplify your administrative tasks. Traditional Copy, Xcopy, Move, and Del (Erase) commands are covered in this chapter, and examples of their usage are included. We continue with the discussion on the use of the Diskcopy command for duplicating disks and comparing disks using the Diskcomp command. Other commands related to file and folder management such as Tree, MD (Mkdir), and RD (Rmdir) are also covered in this chapter. Chapter 5 covers maintenance of file systems and hard disks. The most notable utilities covered in this chapter include Fsutil, Chkdsk, and Defrag. The Fsutil utility is new to the Windows XP and Windows Server 2003 families of operating systems. Although you might have experience with older utilities such as Chkdsk and Defrag, you will need to have thorough knowledge of the operating systems to use the Fsutil command and its subcommands when creating scripts. We will also discuss Format, Convert, and Compact commands in this chapter. Chapter 6 is dedicated to the Diskpart command-line utility used to manage hard disk partitions and volumes. This utility is different from other command-line utilities in that it runs in the Windows command shell as a text-based command interpreter. This utility consists of several commands that run only after the Diskpart interpreter has started. You can use this utility to perform simple disk-related tasks, such as creating and deleting partitions and volumes, and complex tasks, such as creating, maintaining, and managing fault-tolerant volumes. Because Diskpart works in a more enhanced mode than its counterpart, the Disk Management snap-in, it has more control over the selected disk, partition, or volume. Diskpart supports scripting, and you can create scripts to automate repeated disk-related administrative tasks. Diskpart error codes make it easy for you to handle command execution more precisely. In Chapter 7, we explain some of the key issues with maintaining the Windows operating system, including services, drivers, and most importantly, the Windows Registry. We discuss the SC and Reg command-line utilities, which offer sets of several subcommands that are helpful in configuring and maintaining the Windows operating system. You will rarely need to edit the Windows Registry directly, either from the GUI or from the command line, but it is good to understand how you can query, add, delete, save, and restore Registry entries. In Chapter 8, we discuss some command-line utilities for monitoring and managing event logs, processes, and performance logs. Monitoring is an important aspect of system and network administration, and you cannot ignore it. The command-line utilities related to managing Windows event logs covered in this chapter include Eventcreate, Euenttriggers, and Eventquery. You will learn how to view system services and applications using the TaskList command and how to terminate nonresponsive processes using the TaskKill command. This chapter also includes some command-line utilities for monitoring and managing performance logs. These utilities include TypePerf for displaying performance data in the command shell window, Lodctr for registering new performance counters in the Windows Registry, and Relog for extracting and resampling stored performance data. We move on to Chapter 9 to discuss the command-line utilities used to manage printers and print jobs. It is interesting to note that most of these commands have very simple, facile syntax. You will learn that you can use the Prnmngr command to install printers while the Prncnfg command is used to view and configure installed printers. Other commands discussed in this chapter include Prndrvr, Prnport, Prnqctl, and Prnjobs to manage printer drivers, create and configure TCP/IP ports, manage print queues, and manage print jobs, respectively. In Chapter 10, we introduce you to the basic syntax of the Directory Services (DS) commands for managing Active Directory objects. You will learn that the object classes that you can use with DS commands include computers (desktops and member servers), contacts, users, groups, servers (domain controllers), OUs, sites, subnets, quotas, and directory partitions. You will learn how to use the DSQuery command with different types of objects to search for objects in Active Directory, the DSGet command to display properties of specified objects, and the DSAdd and DSRm commands to add objects to or remove objects from the...




