O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Microsoft® Windows® Command-Line Administrator's Pocket Consultant

Book Description

Packed with practical examples, this concise, pocket-sized reference delivers ready answers for using Microsoft Windows command-line tools to manage multiple clients and servers, perform bulk operations, and get more done in less time!

Table of Contents

  1. Microsoft® Windows® Command-Line Administrator's Pocket Consultant
  2. Acknowledgments
  3. Introduction
    1. Who Is This Book For?
    2. How Is This Book Organized?
    3. Conventions Used in This Book
    4. Support
  4. About the Author
  5. I. Windows Command Line Fundamentals
    1. 1. Overview of the Windows Command Line
      1. Command Line Essentials
        1. Understanding the Windows Command Shell
        2. Understanding the MS-DOS Command Shell
        3. Configuring Command-Line Properties
        4. Working with the Command History
      2. Using Windows Support Tools
      3. Using Windows Server 2003 Resource Kit Tools
    2. 2. Getting the Most from the Command Line
      1. Managing Command Shell Startup
      2. Working with the Command Path
        1. Managing the Command Path
        2. Managing File Extensions and File Associations
      3. Redirecting Standard Input, Output, and Error
        1. Redirecting Standard Output to Other Commands
        2. Redirecting I/O to and from Files
        3. Redirecting Standard Error
      4. Chaining and Grouping Commands
        1. Using Chains of Commands
        2. Grouping Command Sequences
    3. 3. Command Line Scripting Essentials
      1. Creating Command Line Scripts
      2. Common Statements and Commands for Scripts
        1. Clearing the Command-Shell Window
        2. Adding Comments to Scripts
        3. Managing Text Display and Command Echoing
        4. Fine-Tuning Command Echo with @
        5. Setting the Console Window Title and Colors
      3. Passing Arguments to Scripts
      4. Getting Acquainted with Variables
      5. Using Variables in Scripts
        1. Naming Variables
        2. Setting Variable Values
        3. Substituting Variable Values
        4. Localizing Variable Scope
      6. Using Mathematical Expressions
        1. Working with Arithmetic and Assignment Operators
        2. Understanding Operator Precedence
        3. Simulating Exponents
      7. Command-Line Selection Statements
        1. Using If
        2. Using If Not
        3. Using If Defined and If Not Defined
        4. Nesting Ifs
        5. Making Comparisons in If Statements
      8. Command Line Iteration Statements
        1. Iteration Essentials
        2. Stepping through a Series of Values
        3. Iterating Through Groups of Files
        4. Iterating Through Directories
        5. Parsing File Content and Output
      9. Creating Subroutines and Procedures
        1. Using Subroutines
        2. Using Procedures
    4. 4. Scheduling Tasks to Run Automatically
      1. Scheduling Tasks on Local and Remote Systems
        1. Introducing Task Scheduling
        2. Accessing and Scheduling Tasks
        3. Monitoring Scheduled Tasks
      2. Scheduling Tasks with the Scheduled Task Wizard
        1. Creating Tasks with the Scheduled Task Wizard
        2. Changing Task Properties
        3. Copying and Moving Tasks from One System to Another
        4. Enabling and Disabling Tasks
        5. Running Tasks Immediately
        6. Removing Unwanted Tasks
      3. Scheduling Tasks with Schtasks
        1. Creating Scheduled Tasks with Schtasks /Create
        2. Changing Scheduled Tasks with Schtasks /Change
        3. Querying for Configured Tasks with Schtasks /Query
        4. Running Tasks Immediately with Schtasks /Run
        5. Stopping Running Tasks with Schtasks /End
        6. Deleting Tasks with Schtasks /Delete
  6. II. Windows Systems Administration
    1. 5. Managing Windows Systems
      1. Examining System Information
      2. Working with the Registry
        1. Understanding Registry Keys and Values
        2. Querying Registry Values
        3. Comparing Registry Keys
        4. Saving and Restoring Registry Keys
        5. Adding Registry Keys
        6. Copying Registry Keys
        7. Deleting Registry Keys
      3. Managing System Services
        1. Viewing Configured Services
        2. Starting, Stopping, and Pausing Services
        3. Configuring Service Startup
        4. Configuring Service Logon
        5. Configuring Service Recovery
      4. Restarting and Shutting Down Systems from the Command Line
        1. Managing Restart and Shutdown of Local Systems
        2. Managing Restart and Shutdown of Remote Systems
        3. Adding Shutdown or Restart Reasons and Comments
    2. 6. Event Logging, Tracking, and Automated Monitoring
      1. Windows Event Logging
      2. Viewing and Filtering Event Logs
        1. Viewing Events and Formatting the Output
        2. Filtering Events
      3. Writing Custom Events to the Event Logs
      4. Monitoring Systems Using Event Triggers
        1. Why Use Event Triggers?
        2. Getting Ready to Use Event Triggers
        3. Creating Event Triggers
        4. Displaying Currently Configured Event Triggers
        5. Deleting Event Triggers
    3. 7. Monitoring Processes and Performance
      1. Managing Applications, Processes, and Performance
        1. Understanding System and User Processes
        2. Examining Running Processes
          1. Obtaining Detailed Information on Processes
          2. Viewing the Relationship Between Running Processes and Services
          3. Viewing Lists of DLLs Being Used by Processes
          4. Filtering Task List Output
        3. Monitoring Processes and System Resource Usage
        4. Stopping Processes
      2. Detecting and Resolving Performance Issues Through Monitoring
        1. Monitoring Memory Paging for Individual Processes
        2. Monitoring Memory Usage and the Working Memory Set for Individual Processes
        3. Performing Detailed Memory Usage Analysis and Determining the Source of Memory Leaks
  7. III. Windows File System and Disk Administration
    1. 8. Configuring and Maintaining Hard Disk Drives
      1. Getting Started with DiskPart
        1. DiskPart Basics
        2. DiskPart: An Example
        3. Understanding Focus and What It Means
        4. DiskPart Commands and Scripts
        5. DiskPart: A Script Example
      2. Installing and Managing Hard Disk Drives
        1. Installing and Checking for a New Drive
        2. Checking Drive Status and Configuration
        3. Changing Drive Partition Styles
          1. MBR and GPT Partition Styles
          2. Converting Partition Table Styles
      3. Working with Basic and Dynamic Disks
        1. Understanding Basic and Dynamic Disks
        2. Setting the Active Partition
        3. Changing the Disk Type: Basic to Dynamic or Vice Versa
          1. Converting a Basic Disk
          2. Converting a Dynamic Disk
      4. Maintaining Hard Disk Drives
        1. Obtaining Disk Information and Managing File Systems with FSUtil
          1. FSUtil: An Overview
          2. Using FSUtil
        2. Checking Disks for Errors and Bad Sectors
          1. Analyzing a Disk Without Repairing It
          2. Fixing Disk Errors
        3. Controlling Auto Check On Startup
          1. Determining Auto Check Status
          2. Configuring Auto Check Parameters
        4. Defragmenting Disks
          1. Understanding and Using Defrag
          2. Marking a Disk as Dirty
          3. Performing Defrag Analysis Only
    2. 9. Partitioning Basic Disks
      1. Obtaining Partition Information
      2. Creating Partitions
        1. Creating Partitions for MBR Disks
          1. Creating Primary Partitions
          2. Creating Extended Partitions with Logical Drives
        2. Creating Partitions for GPT Disks
      3. Managing Drive Letters and Mount Points
        1. Assigning Drive Letters or Mount Points
        2. Changing Drive Letters or Mount Points
        3. Removing Drive Letters or Mount Points
      4. Formatting Partitions
        1. Using Format
        2. Formatting: An Example
      5. Managing Partitions
        1. Converting a Partition or Volume to NTFS
          1. Conversion: Preliminary Checks
          2. Handling Basic Conversions
          3. Using the CvtArea Parameter
        2. Changing or Deleting the Volume Label
        3. Extending Partitions
        4. Deleting Partitions
    3. 10. Managing Volumes and RAID on Dynamic Disks
      1. Obtaining Volume Information and Status
      2. Creating and Managing Simple Volumes
        1. Creating Simple Volumes
        2. Extending Simple Volumes
        3. Bringing Dynamic Disks Online
        4. Deleting Volumes
      3. Providing Fault Tolerance with RAID on Dynamic Disks
        1. Implementing RAID-0: Disk Striping
          1. Using RAID-0
          2. Configuring the Stripe Set
        2. Implementing RAID-1: Disk Mirroring and Duplexing
          1. Using RAID-1
          2. Configuring Mirroring or Duplexing
        3. Implementing RAID-5: Disk Striping with Parity
          1. Using RAID-5
          2. Configuring Disk Striping with Parity
      4. Managing RAID and Recovering from Failure
        1. Breaking a Mirrored Set
        2. Resynchronizing and Repairing a Mirrored Set
        3. Repairing a RAID-0 Striped Set Without Parity
        4. Regenerating a RAID-5 Striped Set with Parity
  8. IV. Windows Active Directory and Network Administration
    1. 11. Core Active Directory Services Administration
      1. Controlling Active Directory from the Command Line
        1. Understanding Domains, Containers, and Objects
        2. Understanding Logical and Physical Structures in Active Directory
        3. Understanding Distinguished Names
        4. Getting Started with the Active Directory Command-Line Tools
      2. Making Directory Queries Using the DSQUERY Command
        1. DSQUERY Subcommands and Syntax
        2. Searching Using Names, Descriptions, and SAM Account Names
        3. Setting Logon and Run As Permissions for Searches
        4. Setting the Start Node, Search Scope, and Object Limit
        5. Setting the Output Format for Names
        6. Using DSQUERY with Other AD Command-Line Tools
      3. Searching for Problem User and Computer Accounts
      4. Renaming and Moving Objects
      5. Removing Objects from Active Directory
    2. 12. Managing Computer Accounts and Domain Controllers
      1. Overview of Managing Computer Accounts from the Command Line
      2. Creating Computer Accounts in Active Directory Domains
        1. Creating a Computer Account
        2. Customizing Computer Account Attributes and Group Memberships
      3. Managing Computer Account Properties
        1. Viewing and Finding Computer Accounts
        2. Setting or Changing a Computer's Location or Description Attribute
        3. Disabling and Enabling Computer Accounts
        4. Resetting Locked Computer Accounts
        5. Moving Computer Accounts
        6. Deleting Computer Accounts
      4. Working with Domain Controllers
        1. Installing and Demoting Domain Controllers
        2. Finding Domain Controllers in Active Directory
      5. Designating Global Catalog Servers
        1. Finding Global Catalog Servers
        2. Adding or Removing a Global Catalog
        3. Checking Caching Settings and Global Catalog Preferences
      6. Designating Operations Masters
        1. Finding Operations Masters
        2. Configuring Operations Master Roles Using the Command Line
    3. 13. Managing Active Directory Users and Groups
      1. Overview of Managing User Accounts from the Command Line
      2. Adding User Accounts
        1. Creating Domain User Accounts
        2. Customizing Domain User Account Attributes and Group Memberships
        3. Creating Local User Accounts
      3. Managing User Accounts
        1. Viewing and Finding User Accounts
        2. Determining Group Membership for Individual User Accounts
        3. Setting or Changing User Account Attributes
        4. Disabling and Enabling User Accounts
        5. Resetting Expired User Accounts
        6. Controlling and Resetting User Passwords
        7. Moving User Accounts
        8. Renaming User Accounts
        9. Deleting User Accounts
      4. Overview of Managing Group Accounts from the Command Line
      5. Adding Group Accounts
        1. Creating Security and Distribution Groups
        2. Creating a Local Group and Assigning Members
      6. Managing Group Accounts
        1. Viewing and Finding Group Accounts
        2. Determining Group Membership
        3. Changing Group Type or Scope
        4. Adding, Removing, or Replacing Group Members
          1. Adding Members to a Group
          2. Removing Members from a Group
          3. Replacing All Members in a Group
        5. Moving Group Accounts
        6. Renaming Group Accounts
        7. Deleting Group Accounts
    4. 14. Administering Network Printers and Print Services
      1. Obtaining Support and Troubleshooting Information for Printers
        1. Tracking Print Drivers and Printer Information
          1. Getting Driver Details for Support and Troubleshooting
          2. Checking Specific Printers, Drivers, and Systems
        2. Tracking Print Spooler Information and Usage Statistics
          1. Getting Spooling Information for Capacity Planning and Troubleshooting
          2. Getting Detailed Spooler Information for Capacity Planning and Troubleshooting
      2. Managing Printers
        1. Understanding Printer Management
        2. Installing Physically Attached Print Devices
        3. Installing Network-Attached Print Devices
        4. Listing Printers Configured on a Computer
        5. Viewing and Setting the Default Printer
        6. Renaming Printers
        7. Deleting Printers
      3. Managing TCP/IP Ports for Network-Attached Printers
        1. Creating and Changing TCP/IP Ports for Printers
        2. Listing Information About TCP/IP Ports Used by Printers
        3. Deleting TCP/IP Ports Used by Printers
      4. Configuring Printer Properties
        1. Adding Comments and Location Information
        2. Sharing Printers
        3. Publishing Printers in Active Directory
        4. Setting a Separator Page and Changing Print Device Mode
        5. Scheduling and Prioritizing Print Jobs
        6. Configuring Spooling and Other Advanced Printer Options
      5. Solving Spooling Problems
        1. Checking the Print Spooler Service
        2. Fixing a Corrupted Spooler
        3. Other Services to Check
      6. Managing Print Queues and Individual Print Jobs
        1. Viewing Jobs in the Queue
        2. Pausing the Printer and Resuming Printing
        3. Emptying the Print Queue
        4. Pausing, Resuming, and Restarting Individual Document Printing
        5. Removing a Document and Canceling a Print Job
    5. 15. Configuring, Maintaining, and Troubleshooting TCP/IP Networking
      1. Using the Network Services Shell
        1. Working with Netsh Contexts
        2. Working with Remote Computers
        3. Working with Script Files
      2. Managing TCP/IP Settings
        1. Setting a Static IP Address
        2. Setting a Dynamic IP Address
        3. Adding IP Addresses and Gateways
        4. Setting DNS Servers to Use
        5. Specifying Additional DNS Servers to Use
        6. Setting WINS Servers to Use
        7. Specifying Additional WINS Servers to Use
        8. Deleting Address Resolution Protocol Cache
        9. Deleting TCP/IP Settings
      3. Supporting TCP/IP Networking
        1. Obtaining and Saving the TCP/IP Configuration
        2. Examining IP Address and Interface Configurations
        3. Working with TCP Internet Control and Error Messages
        4. Examining Fragmentation, Reassembly and Error Details
        5. Examining Current TCP and UDP Connections
          1. Working with TCP
          2. Working with UDP
      4. Troubleshooting TCP/IP Networking
        1. Viewing Diagnostic Information
        2. Diagnosing Mail, News, Proxy Client Problems
        3. Diagnosing General Computer Configuration Issues
          1. Diagnosing IP, DNS, WINS Configuration Issues
        4. Making TCP/IP Connections for Troubleshooting
        5. Attempting to Verify Connectivity
    6. Essential Command-Line Tools Reference
  9. Index
  10. About the Author
  11. Copyright