| | Dedication |
| | Copyright |
| | Foreword |
| | Preface |
| | | Who Should Read This Book |
| | | What's in This Book |
| | | Conventions Used in This Book |
| | | Using Code Examples |
| | | Safari Enabled |
| | | We'd Like to Hear from You |
| | | Acknowledgments |
| | Chapter 1. Introduction |
| | | Section 1.1. Approach to the Book |
| | | Section 1.2. Where to Find the Tools |
| | | Section 1.3. Running Tools with Alternate Credentials |
| | | Section 1.4. A Brief Word on Windows Scripting |
| | | Section 1.5. Getting the Most Out of Your Scripts |
| | | Section 1.6. Where to Find More Information |
| | Chapter 2. System Configuration |
| | | Introduction |
| | | Recipe 2.1. Activating Windows Server 2003 |
| | | Recipe 2.2. Configuring Automatic Updates |
| | | Recipe 2.3. Disabling Windows Update |
| | | Recipe 2.4. Installing or Uninstalling a Windows Component |
| | | Recipe 2.5. Installing an Application or Service Pack via Group Policy |
| | | Recipe 2.6. Viewing System Properties |
| | | Recipe 2.7. Setting the System Time, Date, and Time Zone |
| | | Recipe 2.8. Setting the Name of a Server |
| | | Recipe 2.9. Joining a Server to a Domain |
| | | Recipe 2.10. Testing and Resetting the Secure Channel |
| | | Recipe 2.11. Viewing and Setting Environment Variables |
| | | Recipe 2.12. Configuring Page Files |
| | | Recipe 2.13. Putting System Information on the Desktop |
| | | Recipe 2.14. Configuring System Startup Options |
| | | Recipe 2.15. Configuring System Failure Options |
| | | Recipe 2.16. Viewing System Uptime |
| | | Recipe 2.17. Disabling the Manage/Configure Your Server Screen |
| | | Recipe 2.18. Disabling Shutdown Tracker |
| | | Recipe 2.19. Restarting or Shutting Down a Server |
| | Chapter 3. Disks, Drives, and Volumes |
| | | Introduction |
| | | Recipe 3.1. Viewing the Disk, Drive, and Volume Layout |
| | | Recipe 3.2. Converting a Basic Disk to Dynamic |
| | | Recipe 3.3. Enabling Disk Performance Statistics |
| | | Recipe 3.4. Formatting a Volume |
| | | Recipe 3.5. Setting the Drive Letter of a Volume |
| | | Recipe 3.6. Setting the Label of a Volume |
| | | Recipe 3.7. Cleaning Up a Volume |
| | | Recipe 3.8. Defragmenting a Volume |
| | | Recipe 3.9. Compressing a Volume |
| | | Recipe 3.10. Checking a Volume for Errors |
| | | Recipe 3.11. Making a Disk or Volume Read-Only |
| | | Recipe 3.12. Mapping a Network Drive |
| | | Recipe 3.13. Creating a Virtual Drive to Another Drive or Folder |
| | | Recipe 3.14. Finding Large Files and Folders on a Volume |
| | | Recipe 3.15. Enabling Disk Quotas |
| | | Recipe 3.16. Configuring a Disk Quota for a User |
| | | Recipe 3.17. Viewing Disk Quota Usage |
| | Chapter 4. Files, Folders, and Shares |
| | | Introduction |
| | | Recipe 4.1. Creating and Deleting a File |
| | | Recipe 4.2. Creating and Deleting a Folder |
| | | Recipe 4.3. Undeleting a File |
| | | Recipe 4.4. Securely Deleting a File |
| | | Recipe 4.5. Viewing the Properties of a File or Folder |
| | | Recipe 4.6. Creating a Shortcut |
| | | Recipe 4.7. Creating a Link or Junction Point |
| | | Recipe 4.8. Creating a Program Alias |
| | | Recipe 4.9. Searching for Files or Folders |
| | | Recipe 4.10. Copying, Moving, or Renaming a File or Folder |
| | | Recipe 4.11. Comparing Files or Folders |
| | | Recipe 4.12. Hiding a File or Folder |
| | | Recipe 4.13. Making a File or Folder Read-Only |
| | | Recipe 4.14. Compressing a File or Folder |
| | | Recipe 4.15. Encrypting a File or Folder |
| | | Recipe 4.16. Replacing a File That Is in Use |
| | | Recipe 4.17. Taking Ownership of a File or Folder |
| | | Recipe 4.18. Finding Who Last Opened or Modified a File |
| | | Recipe 4.19. Finding Open Files |
| | | Recipe 4.20. Finding the Process That Has a File Open |
| | | Recipe 4.21. Viewing File Activity |
| | | Recipe 4.22. Performing an Action on Several Files at Once |
| | | Recipe 4.23. Creating and Deleting Shares |
| | | Recipe 4.24. Viewing Shares |
| | | Recipe 4.25. Restricting Access to a Share |
| | | Recipe 4.26. Enabling Web Sharing |
| | | Recipe 4.27. Publishing a Share in Active Directory |
| | Chapter 5. Running and Scheduling Tasks |
| | | Introduction |
| | | Recipe 5.1. Running a Task with Alternate Credentials |
| | | Recipe 5.2. Running a Task on a Remote Server |
| | | Recipe 5.3. Running a Task When a User Logs On |
| | | Recipe 5.4. Running a Task via a Login Script |
| | | Recipe 5.5. Running a Task via Group Policy |
| | | Recipe 5.6. Listing Automatic Tasks |
| | | Recipe 5.7. Scheduling a Task |
| | | Recipe 5.8. Deleting a Scheduled Task |
| | | Recipe 5.9. Listing the Scheduled Tasks |
| | Chapter 6. Processes |
| | | Introduction |
| | | Recipe 6.1. Setting the Priority of a Process |
| | | Recipe 6.2. Suspending a Process |
| | | Recipe 6.3. Killing a Process |
| | | Recipe 6.4. Viewing the Running Processes |
| | | Recipe 6.5. Searching Processes |
| | | Recipe 6.6. Finding the Services Run from a Process |
| | | Recipe 6.7. Viewing the Properties of a Process |
| | | Recipe 6.8. Viewing the Performance Statistics of a Process |
| | | Recipe 6.9. Viewing the DLLs Being Used by a Process |
| | | Recipe 6.10. Viewing the APIs Called by a Process |
| | | Recipe 6.11. Viewing the Handles a Process Has Open |
| | | Recipe 6.12. Viewing the Network Ports a Process Has Open |
| | | Recipe 6.13. Script: Process Doctor |
| | | Recipe 6.14. Script: Process Terminator |
| | Chapter 7. Services |
| | | Introduction |
| | | Recipe 7.1. Starting and Stopping a Service |
| | | Recipe 7.2. Running Any Program or Script as a Service |
| | | Recipe 7.3. Removing a Service |
| | | Recipe 7.4. Setting the Service Startup Type |
| | | Recipe 7.5. Setting the Service Account and Password |
| | | Recipe 7.6. Performing an Action Automatically When a Service Fails |
| | | Recipe 7.7. Viewing the List of Services |
| | | Recipe 7.8. Searching Services |
| | | Recipe 7.9. Finding the Process a Service Is Running From |
| | | Recipe 7.10. Viewing the Antecedent and Dependent Services for a Service |
| | | Recipe 7.11. Viewing the Service Load Order |
| | | Recipe 7.12. Viewing the Startup History of a Service |
| | | Recipe 7.13. Granting the Permission to Manage One or More Services |
| | | Recipe 7.14. Script: Robust Service Restart |
| | | Recipe 7.15. Script: Service Monitor |
| | Chapter 8. Event Logs |
| | | Introduction |
| | | Recipe 8.1. Creating an Event |
| | | Recipe 8.2. Viewing Events |
| | | Recipe 8.3. Creating a New Event Log |
| | | Recipe 8.4. Viewing the Size of an Event Log |
| | | Recipe 8.5. Setting the Maximum Size of an Event Log |
| | | Recipe 8.6. Setting the Event Log Retention Policy |
| | | Recipe 8.7. Clearing the Events in an Event Log |
| | | Recipe 8.8. Restricting Access to an Event Log |
| | | Recipe 8.9. Searching an Event Log on a Server |
| | | Recipe 8.10. Searching the Event Logs on Multiple Servers |
| | | Recipe 8.11. Archiving an Event Log |
| | | Recipe 8.12. Finding More Information About an Event |
| | | Recipe 8.13. Triggering an Action When an Event Occurs |
| | | Recipe 8.14. Script: Event Watcher |
| | Chapter 9. Registry |
| | | Introduction |
| | | Recipe 9.1. Creating and Deleting a Key |
| | | Recipe 9.2. Setting a Value |
| | | Recipe 9.3. Setting Keys or Values Using Group Policy |
| | | Recipe 9.4. Exporting Registry Files |
| | | Recipe 9.5. Importing Registry Files |
| | | Recipe 9.6. Searching the Registry |
| | | Recipe 9.7. Comparing the Registry |
| | | Recipe 9.8. Restricting Access to the Registry |
| | | Recipe 9.9. Backing Up and Restoring the Registry |
| | | Recipe 9.10. Creating a Registry Link |
| | | Recipe 9.11. Setting the Maximum Registry Size |
| | | Recipe 9.12. Monitoring Registry Activity |
| | | Recipe 9.13. Viewing Processes That Have a Registry Key Open |
| | Chapter 10. Network Configuration |
| | | Introduction |
| | | Recipe 10.1. Viewing the Network Configuration |
| | | Recipe 10.2. Disabling a Connection |
| | | Recipe 10.3. Configuring an IP Address |
| | | Recipe 10.4. Renewing or Releasing a DHCP IP Address |
| | | Recipe 10.5. Configuring DNS Settings |
| | | Recipe 10.6. Registering DNS Records or Flushing the DNS Cache |
| | | Recipe 10.7. Finding a Computer's Active Directory Site |
| | | Recipe 10.8. Managing Routes |
| | | Recipe 10.9. Viewing the Open Ports and Connections |
| | | Recipe 10.10. Troubleshooting Network Connectivity Problems |
| | | Recipe 10.11. Viewing Network Traffic |
| | | Recipe 10.12. Configuring TCP/IP Filtering |
| | | Recipe 10.13. Measuring Link Speed and Latency Between Two Hosts |
| | | Recipe 10.14. Installing the IPv6 Stack |
| | Chapter 11. Security Best Practices |
| | | Introduction |
| | | Recipe 11.1. Analyzing Your Security Configuration |
| | | Recipe 11.2. Enabling Auditing |
| | | Recipe 11.3. Renaming the Administrator and Guest Accounts |
| | | Recipe 11.4. Disabling or Removing Unused Accounts, Services, and Software |
| | | Recipe 11.5. Enabling Screensaver Locking |
| | | Recipe 11.6. Disabling Storage of the LM Password Hash |
| | | Recipe 11.7. Requiring Strong Passwords |
| | | Recipe 11.8. Getting Notified of New Security Vulnerabilities |
| | | Recipe 11.9. Script: Mass Admin Password Changer |
| | Chapter 12. Internet Information Services 6.0 |
| | | Introduction |
| | | Recipe 12.1. Installing IIS |
| | | Recipe 12.2. Stopping and Starting IIS |
| | | Recipe 12.3. Creating Web Sites |
| | | Recipe 12.4. Hosting Multiple Web Sites |
| | | Recipe 12.5. Creating Virtual Directories |
| | | Recipe 12.6. Configuring Web Permissions |
| | | Recipe 12.7. Configuring IP Address and Domain Name Restrictions |
| | | Recipe 12.8. Configuring Web Site Authentication |
| | | Recipe 12.9. Obtaining and Installing SSL Certificates |
| | | Recipe 12.10. Enabling SSL on a Web Site |
| | | Recipe 12.11. Backing Up SSL Certificates |
| | | Recipe 12.12. Configuring Web Site QoS Settings |
| | | Recipe 12.13. Configuring Web Site Logging |
| | | Recipe 12.14. Configuring Web Site Redirection |
| | | Recipe 12.15. Enabling Direct Metabase Editing |
| | | Recipe 12.16. Backing Up and Restoring the Metabase |
| | | Recipe 12.17. Exporting and Importing the Metabase |
| | | Recipe 12.18. Enabling Dynamic Content |
| | | Recipe 12.19. Creating Application Pools |
| | | Recipe 12.20. Configuring Application Pool Identities |
| | | Recipe 12.21. Creating Applications |
| | | Recipe 12.22. Isolating Applications into Pools |
| | | Recipe 12.23. Configuring Application Pool Recycling |
| | | Recipe 12.24. Creating FTP Sites |
| | | Recipe 12.25. Configuring FTP Authentication |
| | | Recipe 12.26. Configuring FTP User Isolation |
| | Chapter 13. Domain Name System (DNS) |
| | | Introduction |
| | | Recipe 13.1. Installing the DNS Server |
| | | Recipe 13.2. Starting and Stopping the DNS Server |
| | | Recipe 13.3. Modifying DNS Server Configuration |
| | | Recipe 13.4. Creating a Zone |
| | | Recipe 13.5. Viewing a DNS Server's Zones |
| | | Recipe 13.6. Converting a Zone to an Active Directory-Integrated Zone |
| | | Recipe 13.7. Moving Active Directory-Integrated Zones into an Application Partition |
| | | Recipe 13.8. Creating a Stub Zone |
| | | Recipe 13.9. Configuring Conditional Forwarding |
| | | Recipe 13.10. Configuring Zone Transfer |
| | | Recipe 13.11. Creating and Deleting Resource Records |
| | | Recipe 13.12. Querying Resource Records |
| | | Recipe 13.13. Scavenging Old Resource Records |
| | | Recipe 13.14. Clearing the DNS Cache |
| | | Recipe 13.15. Enabling DNS Server Debug Logging |
| | | Recipe 13.16. Viewing DNS Server Utilization Statistics |
| | | Recipe 13.17. Preventing Cache Pollution on DNS Servers |
| | | Recipe 13.18. Preventing Windows Clients from Attempting Dynamic Updates |
| | | Recipe 13.19. Script: DNS Server Configuration Checker |
| | Chapter 14. DHCP Server |
| | | Introduction |
| | | Recipe 14.1. Installing DHCP Server |
| | | Recipe 14.2. Authorizing a DHCP Server |
| | | Recipe 14.3. Configuring Server Options |
| | | Recipe 14.4. Enabling Address Conflict Detection |
| | | Recipe 14.5. Creating a Scope |
| | | Recipe 14.6. Creating a Superscope |
| | | Recipe 14.7. Activating or Deactivating a Scope |
| | | Recipe 14.8. Configuring Scope Options |
| | | Recipe 14.9. Enabling Dynamic DNS Updates from the DHCP Server |
| | | Recipe 14.10. Managing the Leases for a Scope |
| | | Recipe 14.11. Creating a Reservation |
| | | Recipe 14.12. Enabling DHCP Audit Logging |
| | | Recipe 14.13. Modifying the DHCP Database and Audit Log Paths |
| | | Recipe 14.14. Backing Up the DHCP Database |
| | | Recipe 14.15. Restoring the DHCP Database |
| | | Recipe 14.16. Importing and Exporting DHCP Server Configuration |
| | | Recipe 14.17. Viewing DHCP Utilization Statistics |
| | | Recipe 14.18. Finding the DHCP Servers on a Subnet |
| | | Recipe 14.19. Running DHCP Server on a Domain Controller |
| | Chapter 15. Active Directory |
| | | Introduction |
| | | Recipe 15.1. Creating a New Active Directory Forest |
| | | Recipe 15.2. Promoting a Domain Controller from Media |
| | | Recipe 15.3. Uninstalling Active Directory |
| | | Recipe 15.4. Upgrading from Windows 2000 to Windows Server 2003 |
| | | Recipe 15.5. Raising the Functional Level |
| | | Recipe 15.6. Backing Up Active Directory |
| | | Recipe 15.7. Restoring Active Directory |
| | | Recipe 15.8. Searching for Objects in a Domain |
| | | Recipe 15.9. Creating an Object |
| | | Recipe 15.10. Modifying an Object |
| | | Recipe 15.11. Moving an Object |
| | | Recipe 15.12. Moving an Object to a Different Domain |
| | | Recipe 15.13. Renaming an Object |
| | | Recipe 15.14. Deleting an Object |
| | | Recipe 15.15. Exporting and Importing Objects Using LDIF or CSV |
| | | Recipe 15.16. Finding the Closest Domain Controller |
| | | Recipe 15.17. Enabling and Disabling the Global Catalog |
| | | Recipe 15.18. Finding the FSMO Role Holders |
| | | Recipe 15.19. Transferring or Seizing a FSMO Role |
| | | Recipe 15.20. Creating and Removing a Trust |
| | | Recipe 15.21. Viewing the Trusts for a Domain |
| | | Recipe 15.22. Verifying and Resetting Trusts |
| | | Recipe 15.23. Enabling Diagnostics Logging |
| | | Recipe 15.24. Script: Displaying the Structure of a Forest |
| | Chapter 16. Domain User, Group, and Computer Accounts |
| | | Introduction |
| | | Recipe 16.1. Creating a User Account |
| | | Recipe 16.2. Creating a Large Number of Users |
| | | Recipe 16.3. Modifying an Attribute for Several Users at Once |
| | | Recipe 16.4. Unlocking a User |
| | | Recipe 16.5. Troubleshooting Account Lockout Problems |
| | | Recipe 16.6. Viewing and Modifying the Account Lockout and Password Policies |
| | | Recipe 16.7. Enabling and Disabling a User Account |
| | | Recipe 16.8. Setting a User's Password |
| | | Recipe 16.9. Setting a User's Account Options |
| | | Recipe 16.10. Setting a User's Profile Attributes |
| | | Recipe 16.11. Finding a User's Last Logon Time |
| | | Recipe 16.12. Creating a Group Account |
| | | Recipe 16.13. Viewing the Members of a Group |
| | | Recipe 16.14. Viewing a User's Group Membership |
| | | Recipe 16.15. Adding and Removing Members of a Group |
| | | Recipe 16.16. Changing the Scope or Type of a Group |
| | | Recipe 16.17. Creating a Computer Account |
| | | Recipe 16.18. Joining a Computer to a Domain |
| | | Recipe 16.19. Renaming a Computer |
| | | Recipe 16.20. Resetting a Computer Account |
| | Chapter 17. Exchange Server 2003 |
| | | Introduction |
| | | Recipe 17.1. Preparing Active Directory for Exchange |
| | | Recipe 17.2. Installing the First Exchange Server |
| | | Recipe 17.3. Installing Additional Exchange Servers |
| | | Recipe 17.4. Installing an Exchange Service Pack |
| | | Recipe 17.5. Creating Unattended Installation Files for Exchange and Exchange Service Pack |
| | | Recipe 17.6. Installing Exchange Management Tools |
| | | Recipe 17.7. Delegating Exchange for the First Time |
| | | Recipe 17.8. Stopping and Starting Exchange Server |
| | | Recipe 17.9. Mail-Enabling a User |
| | | Recipe 17.10. Mail-Disabling a User |
| | | Recipe 17.11. Mailbox-Enabling a User |
| | | Recipe 17.12. Deleting a User's Mailbox |
| | | Recipe 17.13. Purging a Deleted Mailbox |
| | | Recipe 17.14. Reconnecting a Deleted Mailbox |
| | | Recipe 17.15. Enumerating Disconnected Mailboxes |
| | | Recipe 17.16. Moving a Mailbox |
| | | Recipe 17.17. Viewing Mailbox Sizes and Message Counts |
| | | Recipe 17.18. Mail-Enabling a Contact |
| | | Recipe 17.19. Mail-Disabling a Contact |
| | | Recipe 17.20. Creating a Mail-Enabled Distribution List |
| | | Recipe 17.21. Creating a Query-Based Distribution List |
| | | Recipe 17.22. Creating an Address List |
| | | Recipe 17.23. Creating a Recipient Policy |
| | | Recipe 17.24. Creating a Storage Group |
| | | Recipe 17.25. Creating a Mailbox Store |
| | | Recipe 17.26. Listing Domain Controllers and Global Catalog Servers Used by an Exchange Server |
| | | Recipe 17.27. Mounting and Dismounting Mailbox Stores |
| | Appendix A. Introduction to WSH |
| | | Section A.1. How to Write Scripts |
| | | Section A.2. WSH 2.0 Versus 5.6 |
| | Appendix B. Introduction to WMI |
| | | Section B.1. Referencing an Object |
| | | Section B.2. Enumerating Objects of a Particular Class |
| | | Section B.3. Searching with WQL |
| | | Section B.4. Authentication with WMI |
| | Appendix C. Introduction to ADSI |
| | | Section C.1. Objects and Interfaces |
| | | Section C.2. Namespaces, ProgIDs, and ADsPaths |
| | | Section C.3. Retrieving Objects |
| | Appendix D. List of Default Environment Variables |
| | Appendix E. List of Default Processes |
| | Appendix F. List of Default Services |
| | Colophon |
| | Index |