0% found this document useful (0 votes)
18 views53 pages

Microsoft SQL Server 2008 Administration With Windows PowerShell 1st Edition Ananthakumar Muthusamy Instant Download

The document provides information about the book 'Microsoft SQL Server 2008 Administration with Windows PowerShell' by Muthusamy Anantha Kumar and Yan Pan, which covers various aspects of SQL Server administration using PowerShell. It includes chapters on PowerShell command types, scripting, managing SQL Server policies, and performance monitoring. The book is published by Wiley Publishing, Inc. and is available for download in multiple formats.

Uploaded by

deismeflierl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views53 pages

Microsoft SQL Server 2008 Administration With Windows PowerShell 1st Edition Ananthakumar Muthusamy Instant Download

The document provides information about the book 'Microsoft SQL Server 2008 Administration with Windows PowerShell' by Muthusamy Anantha Kumar and Yan Pan, which covers various aspects of SQL Server administration using PowerShell. It includes chapters on PowerShell command types, scripting, managing SQL Server policies, and performance monitoring. The book is published by Wiley Publishing, Inc. and is available for download in multiple formats.

Uploaded by

deismeflierl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Microsoft SQL Server 2008 Administration with

Windows PowerShell 1st Edition Ananthakumar


Muthusamy pdf download

https://ebookname.com/product/microsoft-sql-
server-2008-administration-with-windows-powershell-1st-edition-
ananthakumar-muthusamy/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Microsoft Windows Server 2008 R2 Administration Instant


Reference 1st Edition Matthew Hester

https://ebookname.com/product/microsoft-windows-
server-2008-r2-administration-instant-reference-1st-edition-
matthew-hester/

Beginning T SQL with Microsoft SQL Server 2005 and 2008


Paul Turley

https://ebookname.com/product/beginning-t-sql-with-microsoft-sql-
server-2005-and-2008-paul-turley/

Microsoft SQL Server 2008 For Dummies 1st Edition


Chapple

https://ebookname.com/product/microsoft-sql-server-2008-for-
dummies-1st-edition-chapple/

Historical Dictionary of Journalism Historical


Dictionaries of Professions and Industries 1st Edition
Ross Eaman

https://ebookname.com/product/historical-dictionary-of-
journalism-historical-dictionaries-of-professions-and-
industries-1st-edition-ross-eaman/
Silius Italicus Punica Rome s War with Hannibal 1st
Edition Antony Augoustakis

https://ebookname.com/product/silius-italicus-punica-rome-s-war-
with-hannibal-1st-edition-antony-augoustakis/

Welcome to the Cornish Country Hospital The Cornish


Country Hospital 1 1st Edition Jo Bartlett

https://ebookname.com/product/welcome-to-the-cornish-country-
hospital-the-cornish-country-hospital-1-1st-edition-jo-bartlett/

Quick Reference Dictionary of Eyecare Terminology 4th


Edition Janice K. Ledford Comt

https://ebookname.com/product/quick-reference-dictionary-of-
eyecare-terminology-4th-edition-janice-k-ledford-comt/

Teach Yourself VISUALLY iPhoto for iPad 1st Edition


Richard Wentk

https://ebookname.com/product/teach-yourself-visually-iphoto-for-
ipad-1st-edition-richard-wentk/

Metric standards for worldwide manufacturing 2007 ed


Edition Kverneland

https://ebookname.com/product/metric-standards-for-worldwide-
manufacturing-2007-ed-edition-kverneland/
Drafting a Conservation Blueprint A Practitioner s
Guide To Planning For Biodiversity 1st Edition Craig
Groves

https://ebookname.com/product/drafting-a-conservation-blueprint-
a-practitioner-s-guide-to-planning-for-biodiversity-1st-edition-
craig-groves/
Wrox Programmer to Programmer TM

Microsoft ®

SQL Server 2008 ®

Administration ™

with Windows PowerShell


Ananthakumar Muthusamy, Yan Pan

Updates, source code, and Wrox technical support at www.wrox.com


Programmer to Programmer™

Get more out of


WROX.com
Interact Chapters on Demand
Take an active role online by participating in Purchase individual book chapters in pdf
our P2P forums format

Wrox Online Library Join the Community


Hundreds of our books are available online Sign up for our free monthly newsletter at
through Books24x7.com newsletter.wrox.com

Wrox Blox Browse


Download short informational pieces and Ready for more Wrox? We have books and
code to keep you up to date and out of e-books available on .NET, SQL Server, Java,
trouble! XML, Visual Basic, C#/ C++, and much more!

Contact Us.
We always like to get feedback from our readers. Have a book idea?
Need community support? Let us know by e-mailing [email protected]
Professional SQL Server® 2008 Administration with
Windows PowerShell™
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Chapter 1: What Is Windows PowerShell? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 2: Windows PowerShell Command Types, Snap-ins, and cmdlets . . . 15
Chapter 3: Windows PowerShell Programming, Scripting, Error Handling,
and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Chapter 4: Windows PowerShell Functions, Parameters, Sourcing,
Scopes, and User Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Chapter 5: Working with the File System, Registry, and Variables . . . . . . . . . . . 93
Chapter 6: Working with Event Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Chapter 7: Working with Windows Services and Processes . . . . . . . . . . . . . . . . 141
Chapter 8: Working with WMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Chapter 9: WMI Provider for Configuration Management. . . . . . . . . . . . . . . . . . . 197
Chapter 10: WMI Provider for Server Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Chapter 11: Windows PowerShell in SQL Server 2008 Environment,
SQL Server PowerShell Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Chapter 12: Managing Policies through SQLSERVER:\SQLPolicy . . . . . . . . . . 259
Chapter 13: Windows PowerShell and SMO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Chapter 14: Building SQL Server Standards and PowerShell Coding
Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Chapter 15: Building SQL Server Inventory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Chapter 16: SQL Server Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Chapter 17: Collecting SQL Server Performance and Host Performance
Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Chapter 18: Monitoring SQL Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Chapter 19: Monitoring Disk Space Usage, Database Files, and Backups . . 451
Chapter 20: Defining Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Chapter 21: Generating Database Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Appendix A: cmdlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Professional
SQL Server® 2008 Administration with
Windows PowerShell™
Professional
SQL Server® 2008 Administration with
Windows PowerShell™

Muthusamy Anantha Kumar


Yan Pan

Wiley Publishing, Inc.


Professional SQL Server® 2008 Administration with
Windows PowerShell™
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-47728-1
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data
Kumar, Muthusamy Anantha, 1974-
Microsoft SQL server 2008 administration with Windows Powershell / Muthusamy Anantha Kumar, Yan Pan.
p. cm.
Includes index.
ISBN 978-0-470-47728-1 (paper/website)
1. SQL server. 2. Windows PowerShell (Computer program language) I. Pan, Yan, 1976- II. Title.
QA76.73.W56K96 2009
005.2’82--dc22
2009013304
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections
107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or
authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood
Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be
addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201)
748-6011, fax (201) 748-6008, or online at www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or
promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work
is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services. If professional assistance is required, the services of a competent professional person should be sought.
Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or
Web site is referred to in this work as a citation and/or a potential source of further information does not mean that
the author or the publisher endorses the information the organization or Web site may provide or recommendations
it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or
disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade
dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States
and other countries, and may not be used without written permission. SQL Server and Windows PowerShell are
trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. All
other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any
product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be
available in electronic books.
About the Authors
Muthusamy Anantha Kumar, aka MAK (MCTS, MCITP: Database Administrator 2008), is currently the
Senior SQL Server Database Engineer for a leading global financial services firm on Wall Street. He has
published many online articles as a contributing columnist for DatabaseJournal.com. He also pub-
lished online articles for SQL-Server-Performance.com and SQLServercentral.com. His articles can be
found at www.mssqlengineering.com. He also teaches SQL Server Database Administration online at the
University of West Florida.

MAK has been working in information technology for more than 10 years. He has worked in the technol-
ogy side of the finance, dot com, B2B, and software industries. His past clients include Fort James, Boston
Financial, PCConnection, PurchaseSoft, Merrill Lynch, and Jefferies. MAK holds an M.B.A. degree and
various certifications in the computer field.

He also teaches Microsoft SQL Server and has taught many SQL Server developers and DBAs. He has
master’s degree in Business Administration.

MAK lives in New Jersey. He can be reached at [email protected].

Yan Pan (MCITP, MCDBA, OCA) is a Senior DBA for a leading global financial services firm, where
her daily duties include administering hundreds of SQL Server and Oracle servers of every possible
version, working with business units, and troubleshooting database performance problems. She is also a
contributing columnist for DatabaseJournal.com. Her articles can be found at www.yanpansql.com.

Previously, Yan worked as a SQL Server DBA and a .NET developer at Data Based Ads, Inc., and devel-
oped two .NET Web applications. Before that, she worked at AT&T Research Labs. She designed OLAP
cubes with SQL Server Analysis Services and developed PivotTable reports for regional managers. She
has master’s degrees in Computer Science and Physics.

Yan lives in Chicago, IL. She can be reached at [email protected].


Credits
Executive Editor Vice President and Executive
Robert Elliott Group Publisher
Richard Swadley
Development Editor
Rosanne Koneval Vice President and Executive
Publisher
Technical Editor Barry Pruett
Haidong Ji
Associate Publisher
Production Editor
Jim Minatel
Daniel Scribner

Copy Editor Project Coordinator, Cover


Luann Rouff Lynsey Stanford

Editorial Manager Proofreader


Mary Beth Wakefield Jen Larsen, Word One

Production Manager Indexer


Tim Tate Robert Swanson
Acknowledgments

First of all, I would like to thank my fiancée, Claire Hsu. Without her moral support, this book would not
have been possible. I would like to thank my mom, Jayalakshmi Muthusamy, for bringing me into this
world. I still admire her for not losing her patience and always keeping her sense of humor. I would like
to thank my dad, Muthusamy Srinivasan, for being a friend and a teacher. I want to take this opportunity
to thank both my parents for all the compromises they made to raise both my sister and me. I would also
like to thank my sister, Anuradha, for supporting me and taking care of me.

I would like to thank my co-author, Yan Pan, especially for being both very patient when needed and
pushing me when necessary. She is a very good friend and colleague. She could always get me back on
track when I was distracted with other projects.

I would also like to thank all my friends, current and past colleagues, and relatives for their constant
inspiration.

I am very grateful to all the readers and fans of my online articles from various parts of the world. With-
out their support, comments, motivation, and critiques, this book wouldn’t have shaped up so well.

Yan and I are both grateful to Haidong Ji, aka Alex, for introducing us to Wrox-Wiley and being our
knowledgeable technical editor. We also want to thank Bob Elliot for bringing our book proposal to the
executive team and making it happen.

Last but not least, we would like to thank Rosanne Koneval and Daniel Scribner. Your questioning at the
right place, proper decision-making, and quick turnaround made this book much neater and clearer.

It is hoped that I haven’t forgotten anyone, but if I have, it was an oversight. Honest.
— MAK

First and foremost, I would like to thank my beloved husband, Yue Guo. You have always supported
and encouraged me in everything I have ever done. Thank you for your incredible patience throughout
the writing of this book. I would also like to thank my parents for all they have done for me to give me
the best life they could possibly give.

I would like to express my sincere appreciation to MAK for introducing me to technical writing and
sharing the book idea with me. Your optimism, enthusiasm, and humor have made the book-writing
journey a wonderful experience.

I am also deeply indebted to Haidong (Alex) Ji. Haidong, thank you for introducing us to Wrox. Thank
you for your suggestions, guidance, and encouragement throughout the course of this book. Your tech-
nical input and attention to detail helped us improve the quality of this book greatly.

I would also like to thank Bob Elliot, Rosanne Koneval and Daniel Scribner at Wrox. Bob, thank you for
believing in us. We started this project with plenty of enthusiasm and passion for new technology, but
not a book contract. Thank you for making our dream come true and allowing our vision of a Windows
Acknowledgments
PowerShell–powered SQL Server enterprise infrastructure to reach thousands of readers, and hopefully
making their lives easier. Rosanne, thank you for your incredible patience in cleaning up the words and
polishing everything up to get this book ready for the printer. Daniel, thank you for giving a final touch
to this book.

Finally, I’d like to thank you, my readers, for reading what I have written! Without your support and
feedback, I could not have accomplished so much.
— Yan

xii
Contents

Introduction xxi

Chapter 1: What Is Windows PowerShell? 1


Command-Line Interfaces versus Graphical User Interfaces 1
Prerequisites for Installing Windows PowerShell 2.0 2
Installing the Microsoft .NET Framework 6
Installing Windows Remote Management 6
Installing Windows PowerShell 7
Launching Windows PowerShell 10
Using the Command console 11
Using All Programs 11
Using Start Run 11
Summary 13
Chapter 2: Windows PowerShell Command Types, Snap-ins, and cmdlets 15
PowerShell Command Types 16
Native Commands 16
PowerShell cmdlets 18
Shell Function Commands 19
Script Commands 20
Calling PowerShell cmdlets or Scripts from the Command Shell 22
PowerShell Snap-ins 23
Core 24
Host 25
PowerShell.Management 25
Security 26
Utility 27
Diagnostics 27
WsMan.Management 28
PowerShell cmdlet Syntax 28
Named Parameter 28
Positional Parameter 29
Command Chaining 30
Contents
Getting Help 31
Filtering 34
Sorting 38
Formatting 39
Summary 42

Chapter 3: Windows PowerShell Programming, Scripting,


Error Handling, and Debugging 43
PowerShell Scripts 44
PowerShell Variables 44
Arrays 48
Expressions 49
Operators 50
Conditional Expressions 52
IF Statement 53
Loop Construct 54
For Loop 55
While Loop 55
Do-While Loop 56
Do-Until Loop 56
Foreach Statement 57
Input 58
PowerShell Scripting 59
Text File As Input 62
Output 64
Writing to the Console 64
Writing to a File 65
Error Handling 67
Debugging 71
Summary 75

Chapter 4: Windows PowerShell Functions, Parameters, Sourcing,


Scopes, and User Profiles 77
Functions 77
Arguments in Functions 78
Returning Values 80
Script Parameters 81
Sourcing 84
Variable Scope 85

xiv
Contents
Function Scope 87
User Profiles 88
Transcripts 90
Summary 91
Chapter 5: Working with the File System, Registry, and Variables 93
Using Get-PSDrive and Get-PSProvider 93
Working with File System 95
Navigating the File System 96
Managing Files and Directories 98
Managing File Contents 106
Working with the Registry 108
Working with Variables 111
Automatic Variables 113
Preference Variables 115
User-Created Variables 116
Working with Environment Variables 121
Summary 122
Chapter 6: Working with Event Logs 123
Event Log Service 124
Event Viewer 125
Event Logs 125
Log Entry Types 128
Exporting the event logs 134
PowerShell cmdlets Related to event log 136
Summary 140
Chapter 7: Working with Windows Services and Processes 141
What Is a Windows Service? 141
Windows PowerShell and Windows Services 143
Get-Service 144
Stop-Service 146
Start-Service 148
Set-Service 150
Working with Windows Processes 151
Get-Process 153
Stop-Process 155
Summary 157

xv
Contents
Chapter 8: Working with WMI 159
Permission Issues and WMI 159
The WMI Model 161
Working with Event Log 164
Working with Services 170
Working with Processes 179
Working with Environment Variables 186
Working with the Registry 190
Summary 195

Chapter 9: WMI Provider for Configuration Management 197


Managing SQL Server Services 198
Managing Client Network Protocols 203
Managing SQL Server Client Aliases 207
Managing Server Network Protocols 211
Changing FILESTREAM Settings 214
Changing SQL Server Advanced Properties 216
Summary 218

Chapter 10: WMI Provider for Server Events 219


WMI Provider for Server Events 219
WMI Query Language (WQL) 220
Event Handling with Windows PowerShell 2.0 221
Monitoring Errors from the SQL Server Error Log 225
Monitoring Deadlocks 226
Monitoring Blockings 229
Monitoring Login Changes and Failed Login Attempts 233
Monitoring Databases 235
Monitoring Database Objects 236
Summary 239

Chapter 11: Windows PowerShell in SQL Server 2008 Environment,


SQL Server PowerShell Provider 241
sqlps Utility 241
SQLSERVER: Drive and Invoke-Sqlcmd cmdlet 245
SQL Snap-ins 245
Encoding and Decoding Uniform Resource Name (URN) 256
Summary 258

xvi
Contents
Chapter 12: Managing Policies through SQLSERVER:\SQLPolicy 259
SQLSERVER:\SQLPolicy Folder 259
Conditions 263
Policies 268
Summary 281
Chapter 13: Windows PowerShell and SMO 283
PowerShell and the SQLConnection .NET Class 283
Working with SQL Server using SMO 290
Methods and Properties 291
Getting Version Information 291
SQL Server SPID Information 292
SQL Server Server-Related Information 293
SQL Server Database-Related Information 295
Changing the Login Mode 296
Host Information 296
Performance Counters 297
Working with Databases using SMO 297
Working with Tables using SMO 304
Creating Tables 305
Listing Columns 305
Removing Columns 306
Adding Columns 307
Dropping a Table 308
Backup and Restore with SMO 308
Database Backup 308
Transaction Log Backup 311
Differential Backup 312
Restoring Full Backup 313
Restoring a Full Backup and Transaction Log Backup 313
Summary 316

Chapter 14: Building SQL Server Standards and PowerShell


Coding Standards 317
SQL Server Standards 318
SQL Server Development Standards 318
Naming Conventions 318
General Rules 320
Stored Procedure Standards 321
Keep Them Small 321
‘‘DBO’’ As Object Owner 321

xvii
Contents
Use Comments Generously 321
Select * 322
Cursors 322
Temporary Tables 322
Things to Avoid 322
Things to Use 323
Check @@ERROR 323
Use SQL Server Date Data Types 323
DML Statements 323
ANSI-Standard Join Clauses 323
Deprecated Features 324
Database Design Standard and Best Practices 324
User-Defined Tables 324
Logs 324
Split tempdb 325
Databases 325
Security and Roles 325
Auto Create and Auto Update 325
Size 325
Auto Shrink and Auto Close 325
Design and Performance 326
Store Unstructured Data 326
More Performance Guidelines 326
Data Protection Standards and Best Practices 327
Backup Policy 327
SQL Server Production Standards 327
High Availability and Disaster Recovery 327
The Administration Database 328
The Scratch Database 328
Centralized Inventory Server 328
Database File Location and RAID 328
Segregation 328
Features 328
PowerShell Coding Standard 329
Default Parameters 329
Log File 329
Log Format 329
Comments 330
Display 330
Variable Naming Convention 330
Exception Handling 330
Summary 331

xviii
Contents
Chapter 15: Building SQL Server Inventory 333
SQL Server Inventory 333
Hosts 335
Clusters 346
ClusterNodes 350
Servers 355
Databases 368
Supplementary Tables 373
Summary 376

Chapter 16: SQL Server Installation 377


Installation Procedure and Template 377
SQL Server Installation Template 381
Standalone Installation Example 389
Cluster Installation Example 395
Summary 399

Chapter 17: Collecting SQL Server Performance and Host


Performance Data 401
SQL Server Performance Data Collection 401
SQL Server Host Performance Data Collection 408
Summary 417
Chapter 18: Monitoring SQL Server 419
Pinging SQL Server Hosts 420
Checking SQL Server–related Services on SQL Server Hosts 423
Checking Uptime of SQL Server Hosts 427
Monitoring Windows Event Logs 429
Monitoring SQL Server Error Log 433
Monitoring Blockings 439
Monitoring Deadlocks 444
Summary 449
Chapter 19: Monitoring Disk Space Usage, Database Files, and Backups 451
Monitoring Disk Space Usage 451
Monitoring Database Files 461
Monitoring Backups 468
Summary 473

xix
Contents
Chapter 20: Defining Policies 475
Stored Procedure Naming Convention Policy 475
Auto_Close and Auto_Shrink Off Policy 480
Summary 485
Chapter 21: Generating Database Scripts 487
Scripting Databases 487
Scripting Schemas 489
Scripting User-Defined Data Types 491
Scripting Tables 494
Scripting User Views 496
Scripting Stored Procedures 498
Scripting Functions 500
Scripting XML Schemas 502
Scripting Users 503
Summary 506

Appendix A: cmdlets 507


cmdlets Related to Core Snap-ins 507
cmdlets Related to the PowerShell Management Snap-in 512
cmdlets Related to the Security Snap-in 519
cmdlets Related to the Utility Snap-in 520

Index 531

xx
Introduction

Welcome to SQL Server 2008 Administration with Windows PowerShell. This book is a nuts-and-bolts guide
to creating Windows PowerShell scripts that can be used to administer every aspect of the SQL Server
2008 Database Engine. Using a very hands-on approach, this book guides you through the basics of
Windows PowerShell, the available Windows PowerShell components that have been integrated into
SQL Server 2008, and the actual administration tasks. By providing clear, well-structured examples, SQL
Server 2008 Administration with Windows PowerShell shows you how to construct effective and practical
solutions that can improve SQL Server administration and monitoring at your company.

SQL Server 2008 delivers a dynamic, smart, and productive data platform for all your data-related
needs. SQL Server 2008 offers secure, reliable, and consistent performance. It is also very scalable and
flexible, handling any form of data. It is well known in the technology world that SQL Server 2008 is not
only a RDBMS, but also has built-in features such as Integration Services for ETL, Analysis Services for
Business Intelligence, Reporting Services for report management, and more. This is why Microsoft SQL
Server is a cut above all other database products.

Windows PowerShell 2.0 is the new extensible command-line interface shell and scripting language that
provides an environment for interactive scripting and non-interactive scripted administration of local
and remote computers. Because Windows PowerShell integrates with the Microsoft .NET Framework,
we can take advantage of all the features of .NET as well. Windows PowerShell 2.0 helps system admin-
istrators to automate and manage various aspects of the Windows environment. PowerShell 2.0 also has
many new and useful features such as remoting, eventing, and many more. For these reasons, Windows
PowerShell 2.0 stands above all the system administration products on the market.

This book brings together the best of both worlds — namely, the database world and the administra-
tion world — to help you manage, automate, and control your environment. This book combines three
technologies — SQL Server 2008, the .NET Framework, and Windows PowerShell 2.0 — and guides SQL
Server database administrators in managing a server plant using Windows PowerShell 2.0.

We’ve provided a wide range of material in a tutorial-based book to get you over the learning curve of
Windows PowerShell 2.0 and SQL Server 2008 database administration.

Who This Book Is For


Whether you are a SQL Server database administrator, a developer, or a systems administrator, at some
point you probably have had to develop or administer the system or the database in your organization.
It is also common for the people in these roles to wear each other’s hats in order to get things done.

If you are a Microsoft SQL Server database administrator, you know that you cannot manage and access
all the system resources from SQL Server. Because SQL Server runs on top of the Windows operating
system and relies on the health of the system, you need information from the system side as well. This
book will teach you to manage both SQL Server and system resources using Windows PowerShell 2.0.
Introduction
If you are a systems administrator and would like to know more about SQL Server database adminis-
tration, this book introduces you to the features in SQL Server 2008 and provides plenty of examples
demonstrating how to manage SQL Server 2008 using Windows PowerShell 2.0.

This book is also appropriate for those who have some exposure to systems administration and SQL
Server administration, or for those who want to expand their skill set to include administration.

What This Book Covers


This book covers the fundamentals of Windows PowerShell 2.0 cmdlets. It includes programming, script-
ing, debugging, and error handling in PowerShell. It covers all Windows administration related to SQL
Server 2008 using Windows PowerShell 2.0.

It also introduces Windows Management Instrumentation (WMI) and explains how to write WMI scripts
in Windows PowerShell to perform system and SQL Server 2008 administrative tasks.

This book also covers the WMI providers for SQL Server. These useful providers enable you to manage
SQL Server services and network connectivity, and proactively monitor SQL Server events. You will also
discover the new Eventing feature in Windows PowerShell 2.0.

Additionally, the new SQL Server 2008 support for Windows PowerShell is presented. It illustrates the
SQL Server PowerShell provider and SQLSERVER: drive. You will also learn how to manage SQL Server
objects, including the new policy objects.

One more important topic this book covers is using SQL Server Management Objects (SMO) to create
databases and tables and perform backups and restores. The SMO scripts shown in this book are all
written in Windows PowerShell 2.0.

This book also explains the need for SQL Server standards; and you will learn how to build a SQL Server
inventory over an existing or new environment.

Finally, you will learn how to perform the various SQL Server administrative tasks on servers in the
inventory, such as installation, monitoring, performance data collection, policy definition, backups,
restores, database scripting, and more, using Windows PowerShell 2.0.

How This Book Is Structured


Windows PowerShell 2.0 is introduced in the first eight chapters. If you do not have any background
in Windows PowerShell 2.0, these chapters are critical. They help you understand the basics of writing
Windows PowerShell 2.0 scripts, and you will learn how to use the scripts to administer the overall
operating system.

Chapter 1 covers installation of prerequisites, and installation and configuration of Windows


PowerShell 2.0.

Chapters 2, 3, and 4 cover the various cmdlets available in Windows PowerShell, and the various pro-
gramming features such as inputs, outputs, debugging, error handling, functions, profiles, and so on.

xxii
Introduction
Chapters 5, 6, 7, and 8 cover the various systems administration features, including accessing file systems,
registry information, variables, and Event logs. It also explains the Windows Management Instrumenta-
tion (WMI) model and shows you how to use WMI to manage system resources.

Chapters 9 and 10 show you how to access the WMI providers for SQL Server. You will learn how to use
the WMI Provider for Configuration Management to manage SQL Server services and network connec-
tivity, and the WMI Provider for Server Events to manage SQL Server events. You will also discover the
new Eventing feature in Windows PowerShell 2.0.

Chapters 11 and 12 take on the Windows PowerShell support that has been integrated into SQL Server
2008, namely, the SQLSERVER: drive. These two chapters will focus on the SQL and SQLPolicy folders
separately.

Chapter 13 shows you how to write SQL Server Management Objects (SMO) programs in Windows
PowerShell 2.0. This chapter covers various tasks such as creating a database and database objects, and
backing up and restoring a database.

Chapters 14 and 15 provide you with ample examples of building a SQL Server tasks inventory over an
existing or new environment, and how to define various standards. Standards include both SQL Server
standards and Windows PowerShell standards.

The remaining chapters explain installation, data collection, monitoring, and how to create Windows
PowerShell scripts to handle a wide range of SQL Server administrative tasks for servers in the inventory.

Chapter 16 illustrates the installation of SQL Server 2008. Chapter 17 covers tasks related to collecting
SQL Server host and server performance data. Chapters 18 and 19 cover monitoring aspects of SQL
Server 2008 administration. Chapter 20 defines policies to enforce SQL Server standards, and Chapter 21
generates various scripts at both the database level and the database object level.

What You Need to Use This Book


This book covers SQL Server 2008 administration with Windows PowerShell 2.0. In order to use this
book, you need both a server-side component and client-side components:

❑ For the server-side component, you need SQL Server 2008 Developer or Enterprise or Standard
edition.
❑ For client-side components, you need Windows PowerShell 2.0 CTP3. To install Windows
PowerShell 2.0 CTP3, the operating system of your computer needs to be either Windows XP
Service Pack 3, Windows 2003 Service Pack 2, Windows Vista Service Pack 1, or Windows Server
2008. You also need to pre-install the following components on your computer:

❑ Microsoft .NET Framework 2.0 or greater


❑ Windows Remote Management 2.0 CTP3 for Windows PowerShell remoting and back-
ground jobs

We discuss the prerequisites of Windows PowerShell 2.0 in Chapter 1 in detail.

xxiii
Random documents with unrelated
content Scribd suggests to you:
have no objection Miss, and if you don't think as it would be a
liberty, us has all made up our minds upon having it christened
Clara, and please to say Miss if it be too high, or any way unfitty.
Father be 'most afeared that it sound too grand for the like of us,
but mother says as the Huxtables was thought brave things on, to
Coom and Parracombe a hundred years agone.
Please Miss, father heard to Coom market last week, as there's
going to be a French invasion, and they be sure to go to London
first, and he beg you to let him know as soon as ever there be one,
and he come up at once with the big ash-stick and the ivy on it as
growed in Challacombe wood, and see as they doesn't hurt you,
Miss.
Please Miss, the young chap as saved you from the great goyal
come here to ask for you, day after you was gone, and mother
believes he baint after no good, by token he would not come in nor
drink a drop of cider.
Please Miss, father say it make his heart ache every night, to
think of you all to yourself in the wicked London town, and he go
down the lane to the white gate every evening in the hope to see
you acoming, and mother say if you be a selling red and blue picturs
her hope you will send for they as father gave the hog's puddens for,
and us wont miss them at all.
And Miss Clara dear, I expect you'll be mazed to see how I
writes and spells, father say it must be in the family, and I won't
write no more till I have finished another dozen of copy books; and
oh dear how I do wish that you were come back again, but father
say to me to say no more about it for fear to make you cry, Miss. All
the little childers except the new babby who have not seen you yet,
sends their hearts' loves and duty and a hundred kisses, and father
and mother the same, and Timothy Badcock, and Tabby, and Suke,
and Beany Dawe, now he knows it.
I remain, Miss Clara dear, your thankful and loving scholar to
command,

SARAH HUXTABLE.
Signed all this here papper scrawl in the settle by the fire.
JOHN HUXTABLE his mark X
HONOR HUXTABLE hern X."

CHAPTER XVI.

I was much grieved at the loss of my last letter to Tossil's Barton,


because it contained my little Christmas presents for all the family. It
was registered for security, but I suppose they "took no count" of
that where the delivery of letters depended so much upon luck. Of
their Christmas present to me I resolved to give the surplus to those
who would be the better for it, and not (according to the usual law
of such things) to those who did not want it, and would make return
with interest. So on the Christmas morning Mrs. Shelfer and myself,
each carrying a large basket, went to the mews round the corner,
and distributed among the poor lodgers there, more Christmas
dinners than had ever entered those doors before; and how grateful
the poor things were, only they all wanted the best.
Now the school of design was closed for a while, and I worked
hard for several days at the landscape for Mr. Oxgall, though the
store of provisions sent me and the rent enclosed in the turkey had
saved me from present necessity.
On the day of all days in the year the saddest and darkest to
me, I could not keep to my task, but went for a change of thoughts
to the school, now open again.
It was the 30th of December, 1850, and, though I crouch not to
the mumming of prigs scolloped out at the throat, who block out
with a patchwork screen the simple hearth of religion, and kneel at
an ashbin to warm themselves; though I don't care a herring for
small anniversaries dotted all over the calendar, and made by some
Murphy of old; yet I reverence deeply the true feasts of Church and
Chapel, the refreshings of faith and charity, whereupon we forgive
and are sorry for those who work hard to mar them. Neither does it
seem to me--so far as my timid and wavering judgment extends--to
be superstition or vanity, if we dare to set mark by those dates in
our own little span which God has scarred on our memory.
In the long dark room so bare and comfortless, and, to-day, so
lonely and cold, I got my usual books and studies, and tried, all in
vain, to fix my attention on them. Finding the effort so fruitless, I
packed up my things in the little black bag and rose to depart.
Turning round, I saw on the table, where students' works were
exhibited, a small object newly placed there. It was a statuette in
white marble of a magnificent red deer, such as I had seen once or
twice in the north of Devon. The listening attitude, the turn of the
neck, the light poise of the massive head, even the mild, yet spirited
eye, and the quivering sensitive lip, I could answer for them all, they
were done to the very life. Truth, power, and elegance triumphed in
every vein of it. For a minute I stood overcome with wonder. If this
were the work of a youthful sculptor, England might hope at last for
something beyond the grotesque.
Before me rose at once all the woodland scenery, the hill-side
garbed with every shade of green, the brambled quarry standing
forth, the trees, the winding vales embosoming the light, the haze
that hovers above the watersmeet, bold crests of amaranth heath
behind, and far away the russet wold of Exmoor. The stag in the
foreground of my landscape, I feel so grateful to him for this
expanse of vision that I stoop down and kiss him, while no one can
see me. As I bend, the gordit drops from its warm home in my
breast. By some impulse undefined I lift the ribbon from my neck,
and hang the little fairy's heart on the antlers of the Devonshire
deer. Out springs from behind a chest full of casts and models--what
model can compare with her?--the loveliest of all lovely beings, my
little Isola Ross.
I hide the tears in my eyes, and try to look cold and reserved.
What use is it? One smile of hers would have disarmed Belial.
"It isn't my fault, dear. It isn't indeed. Oh, please give me that
cordetto. No don't. That is why I loved you so at first sight. And here
is all my money dear. I have carried it about ever since, though I
sewed up the purse not to spend it, and only once cut it open. They
made me promise, and I would not eat for three days, and I tried to
be sulky with Pappy because he did not care; they made me promise
with all my honour not to go and see you, and Cora came about with
me so that I had no chance of breaking it. And I would not tell them
where you lived, dear; but I led old Cora a dance through your
street on the side you live, till she began to suspect. But I could
never see you, though I looked in at all the windows till I was quite
ashamed, and the people kissed their hands to me."
Poor little dear! I lived upstairs, and could not have seen her
without standing out on the balcony, which was about the size of a
chess-board. If she had not been so simple as to walk on my side of
the street, she must have seen me ere long, for I sat all day near
the window to draw, when I was not away at my school.
I forgave her most graciously for having done me no wrong,
and kissed her with all my heart. Her breath was as sweet as violets
in Spring clover, and her lips warm and soft as a wren's nest. On
receiving my forgiveness, away she went dancing down the long
room, with her cloak thrown off, and her hair tossing all out of braid,
and her exquisite buoyant figure floating as if on a cloud. Of course
there was no one there, or even impulsive Isola would hardly have
taken her frolic; and yet I am not sure. She never thought harm of
any one, and never imagined that any one could think harm of her.
After a dozen flits of some rapid elegant dance quite unknown
to me (who have never had much of dancing), but which I supposed
to be Scotch, back she came out of breath, and kissed me ever so
many times, and kissed my gordit too, and told me never to part
with it. One thing she was sure of, that her Papa could not resist me
now, and when he was told of it I should come to their house the
next day. And she knew I was dreadfully proud, but would I, for her
sake, forgive her Pappy? Of course, he knew nothing about me, and
she had never told him my name, though she could not help telling
my story, at least all she knew of it; but he was so dreadfully jealous
of her, he did not want any one to have a touch of her glove but
himself.
Looking at her pure sweet face, I could well believe it; but how
could he bear to see that dear little thing go three days without
food? Most likely she had exaggerated. Although she was truthful as
light, sometimes her quick fancy and warmth, like the sunshine itself,
would bring out some points too strongly. However, I was prepared,
without that, to dislike the Professor, for, as a general rule, I don't
like men who moralise; at least if their philosophy is frigid.
Nevertheless, I promised very readily to forgive her Papa, for I did
so love that Isola. Her nature was so different to mine, so light and
airy, elastic and soft; in short (if I must forsake my language), the
complement of my own. We chatted, or rather she did, for at least
half an hour; and then she told me old Cora was coming to fetch her
at three o'clock. Once more I rose to depart, for I feared she might
get into trouble, if the old nurse should find her so intimate with a
stranger.
But Isola told me that she did not care for her a bit, and she
had quite set her heart on my meeting her brother Conrad, the
sculptor of that magnificent stag. Perhaps he would come with Cora,
but he was so altered now, she could never tell what he would do.
Since the time she first saw me, Conrad had come of age, and she
could not guess what it was all about, but there had been a dreadful
disturbance between him and his father, and he had actually gone to
live away from the family. She thought it must be about money, or
some such nasty thing; but even Cora did not know, or if she did,
the old thing would not tell. It had made poor Isola cry till her eyes
were sore, but now she supposed she must make up her mind to it
all. But she would tell the truth, she did hate being treated like a
baby when she was a full-grown woman; how much taller did they
expect her to be? And what was much worse, she did want so to
comfort them both, and how could she do it without knowing what
was the matter? It was too bad, and she wished she was a boy, with
all her heart she did.
She went on talking like this till her gentle breast fluttered, and
her coral lips quivered, and the tears stole down her long lashes,
and she crept to me closer for comfort.
I was clasping her round little waist, and kissing the bright
drops away, when in burst a dark, scraggy woman, who must, of
course, be old Cora. She tore the poor child from my arms, and
scowled at me fiercely enough to frighten a girl unacquainted with
real terrors.
I met her dark gaze with a calm contempt, beneath which it
quailed and fell. She mumbled some words in a language or patois,
which I supposed to be Gaelic, and led off her charge towards the
door.
She had mistaken her adversary. Was I to be pushed aside, like
a gingerbread woman tempting a weak-stomached child? I passed
them; then turned and confronted the hag.
"Have the goodness, old woman, to walk behind this young lady
and me. When we want your society, we will ask for it. Isola Ross,
come with me, unless you prefer a rude menial's tyranny to a lady's
affection."
Isola was too frightened to speak. I know not what would have
been the result, if the old hag, who was glaring about, rather taken
aback, but still clutching that delicate arm, had not suddenly spied
my fairy's heart, as yet unrestored to its sanctuary.
She stared, for a moment, in wide amazement; then her whole
demeanour was altered. She cringed, and fawned, and curtseyed, as
if I had worn a tiara. She dropped my dear Isola's arm, and fell
behind like a negress. My poor little pet was trembling and cold with
fright, for (as she told me afterwards) she had never seen old Cora
in such a passion before, and the superstitious darling dreaded the
evil eye.
As we went towards Isola's home, I could not help thinking how
fine the interview would be between Mrs. Shelfer and Cora, if I only
chose to carry that vanquished beldame thither; but sage discretion
(was I not now eighteen?), and the thought of that solemn day
prevented me. So I took them straight home, leading Isola while she
guided me, and turning sometimes, with complacency, to encourage
old Cora behind us.
The house they lived in was a high but narrow one, dull-looking
and dark, with area rails in front. Some little maiden came to the
door, and I took my leave on the steps. Dear Isola, now in high
spirits again, kissed me, like a peach quite warm in the sun, and
promised to come the next day, about which there could now be no
difficulty.
Old Cora bent low as she wished me good evening and begged
leave to kiss my cordetto. This I granted, but took good care not to
let it pass out of my hands; she admired it so much, especially when
allowed to examine it, and there was such a greedy light in her eyes,
that I was quite sure she would steal it upon the first chance; and
therefore I went straightway and bought a guard of thick silk cord,
as a substitute for the black riband, which was getting worn.
And so I came home before dark, full of wonder, but feeling
rather triumphant, and greatly delighted at having recovered dear
Isola.

END OF VOL. I.

LONDON:
R. CLAY, SON, AND TAYLOR, PRINTERS,
BREAD STREET HILL.

*** END OF THIS PROJECT GUTENBERG EBOOK CLARA VAUGHAN,


VOLUME I (OF III) ***
*** END OF THE PROJECT GUTENBERG EBOOK CLARA VAUGHAN,
VOLUME 1 (OF 3) ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in


the United States and most other parts of the
world at no cost and with almost no restrictions
whatsoever. You may copy it, give it away or re-
use it under the terms of the Project Gutenberg
License included with this eBook or online at
www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of
the country where you are located before using
this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.
1.E.4. Do not unlink or detach or remove the full Project
Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.
1.F.1. Project Gutenberg volunteers and employees expend
considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.
Section 2. Information about the Mission
of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.
Please check the Project Gutenberg web pages for current
donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like