Scripts and Primers in the Win2K Scripting Guide
Looking for scripting resources? Find them here
May 26, 2003
One of the questions that I'm asked most frequently is where to find scripting resources. One of the best resources that I've recently come across is the Microsoft Windows 2000 Scripting Guide. In addition to primers that help you get your feet wet with various scripting technologies, the book contains scripting building blocks that you can use to quickly build your own script library. Written by the Microsoft Windows Resource Kit Scripting Team, the book contains more than 400 sample scripts that perform a variety of Windows administrative tasks. This month, I introduce you to 10 cool collections of scripts and scripting information that you'll find in this book.
10. The Scriptomatic tool—The Scriptomatic tool generates and optionally runs Windows Management Instrumentation (WMI) code. WMI can be difficult to learn, but Scriptomatic can help you get started. The tool lets you select the WMI objects that you're interested in, then generates the VBScript or Windows Script Host (WSH) code required to use the WMI object. You can run the code as-is or copy it into your own scripts.
9. VBScript primer—If you're new to scripting in the Windows environment, you'll find the VBScript primer a great way to dip a toe into VBScript, Microsoft's core Windows scripting language. The primer illustrates the basic VBScript concepts, such as how to create variables, manipulate strings, retrieve system date and time, perform loops, and write If tests.
8. WSH primer—Whereas the VBScript primer presents the language basics, the WSH primer digs deeper. This primer explains the components of the WSH architecture as well as how to use the WshShell, WshNetwork, and WshController objects.
7. Script Runtime primer—Neither WSH nor VBScript provide many capabilities for managing the file system. If you want to automate file management tasks, check out the Script Runtime primer. This chapter explains how you can use the Script Runtime library to retrieve information about the file system and to copy, move, and delete files and folders.
6. ADSI primer—The second part of Microsoft Windows 2000 Scripting Guide explains how to use the two core administrative object libraries. The first of these libraries is the Microsoft Active Directory Service Interfaces (ADSI) object, which you can use to access Active Directory (AD). This primer provides scripts that show how to establish a connection to AD, create directory service objects, and enumerate objects and containers.
5. WMI primer—WMI is the second core administrative object library that Microsoft Windows 2000 Scripting Guide explains. This section provides an architectural overview of WMI followed by sample scripts that show you how to retrieve managed resources, work with the system date and time, and even use notifications.
4. Files and folders—You'll find one of the book's most important collections of scripts in the "Files and Folders" chapter. The scripts in this section show how to enumerate folders and files as well as how to copy and delete files and read and write data values to a file.
3. Computer assets—The "Computer Assets" chapter of Microsoft Windows 2000 Scripting Guide includes an especially useful collection of sample scripts. Among the samples, you'll find scripts that can identify OSs, enumerate installed software, install and remove software, and shut down and restart the system.
2. Registry—The scripts in the "Registry" chapter provide examples that illustrate how to read values from the registry as well as how to create and delete registry keys and values. Other scripts in this chapter show you how to back up the registry and enumerate registry keys.
1. Creating enterprise scripts—The "Scripting for the Enterprise" section contains probably the book's most important collection of scripts for the Windows administrator. Among other things, this section shows you how to retrieve script arguments from a file or database, how to send email from scripts, how to use Microsoft Internet Explorer (IE) to display data, and how to mask your password.
About the Author
You May Also Like