If you've been patiently following along with me through the previous thirteen articles of this Managing Windows networks using scripts tip series, you should have gained some basic confidence in writing WMI scripts to manage various aspects of Windows-based networks. Specifically, you should have learned the following that are essential for successful WMI scripting:
- Understanding basic WMI scripting concepts such as classes objects, properties and methods (see Managing Windows networks using scripts, Part 1 -- The basics)
- How to write proper code by defining variables, handling errors, input/output and commenting (see Managing Windows networks using scripts, Part 2 -- Cleaning up)
- Understanding WMI namespaces, providers and classes and how to use MSDN to learn how to use a particular WMI class (see Managing Windows networks using scripts, Part 3 and Part 4)
- How to work with remote scripting and troubleshoot issues that might arise (see Managing Windows networks using scripts, Part 6 through 10)
- How to retrieve system and network settings by enumerating the properties of a WMI class instance (see Managing Windows networks using scripts, Part 12 and Part 13)
Obviously though, we're just getting started learning to script. There's tons more you can do with WMI and I could go on writing articles like these until hell freezes over. But my goal with this series of articles was basically just to get you up and
Now, in this final article, I want to mention some useful resources you can use to learn more about WMI scripting on your own. And as you make progress learning how to script the management of Windows-based networks, do feel free to share what you've learned with me by emailing me as I'd love to hear what you're learning about Windows scripting.
So anyway, let's take a quick look at where you can go from here to learn more about how to script using WMI.Books
I like learning from books because you can carry them anywhere, read them on the bus, write in the margins, use highlighters and so on. Of course you can do all that with a slate-format Tablet PC with PDF Annotator installed if your book has a CD-ROM inside the back cover that includes the full book content in PDF form (as most titles from Microsoft Press have). But forking over $3000 for a Tablet PC is a bit more than spending $50 on a book, right?
Some of my favorite books for learning scripting include the following:
- Microsoft Windows Scripting Self-Paced Learning Guide by Ed Wilson (Microsoft Press): Ed wrote many of the scripts on the companion DVD included with the Windows Vista Resource Kit so he knows what he's talking about and he makes scripting fun and easy while teaching the basics.
- Another good book for beginners by Ed is the Microsoft VBScript Step by Step (Microsoft Press), and be sure to check out his latest book Microsoft Windows PowerShell Step By Step (Microsoft Press) if you want to start learning about PowerShell, Microsoft's latest and greatest scripting platform.
- Advanced VBScript for Microsoft Windows Administrators by Don Jones and Jeffrey Hicks (Microsoft Press) is an excellent book that gets into a ton of advanced scripting topics including ADSI and LDAP scripting, database scripting, WMI events, using WMI tools, and scripting Exchange Server, Virtual Server and other Windows Server applications. The book goes beyond simple VBScript scripting and looks at how to package script jobs into WSF files using XML to make them more usable and repurposable (and better code).
- Don Jones also wrote the scripts in the Microsoft Windows Administrator's Automation Toolkit (Microsoft Press) that was included as part of the Windows Server 2003 Resource Kit (Microsoft Press, and that title (and the whole Resource Kit) are must-haves also for Windows administrators.
- Another book Don wrote is Managing Windows with VBScript and WMI (Addison-Wesley) and that's another useful title to add to your bookshelf.
- Finally, O'Reilly Media has a whole series of "cookbooks" that provide quick VBScript solutions to perform basic administrative tasks. One particular favorite of mine is the Active Directory Cookbook by Robbie Allen and Laura E. Hunter, and another I sometimes find useful is the Windows Server Cookbook for Windows Server 2003 and Windows 2000 which is also by Robbie Allen. Just thinking of these great books makes me hungry!
The best place to go on the Web to learn more about Windows scripting in all its various forms is the Script Center on Microsoft TechNet. The only trouble with this site is there's too much there to absorb. It can be daunting for newcomers to find their way around its various resources and learn what they need (or learn what they need to learn). So let me point out a few highlights specifically related to WMI scripting using VBScript:
- Sesame Script is a series of witty introductory articles covering scripting basics such as loops and decisions, data types, working with strings and dates, subroutines and functions, and other stuff. Great for filling in the gaps if you don't have any prior computer programming experience. Of course if you prefer to learn things systematically (or if you have no sense of humor) you can always read the VBScript Primer and WMI Primer from start to finish (good luck), but be aware that some aspects of WMI have changed since the WMI Primer was written (circa Windows 2000). You can find more up to date information about WMI on MSDN (though be aware that MSDN too is sometimes out of date or contains errors).
- Tales from the Script (eeek!) has a collection of miscellaneous and often quite funny articles on various scripting topics that are a bit more advanced sometimes and definitely worth a look.
- Hey, Scripting Guy! has a ton of useful short question and answer articles on various scripting topics, usually at an intermediate level. You can even download the entire archive of Scripting Guy articles so you can read them offline, which is nice. And yes, The Scripting Guys do exist and they are real human beings (in case you were wondering).
- Scripting Tools and Utilities: Sometimes Notepad just doesn't cut it for writing scripts. You can find tools here that will take some of the pain out of scripting, though an alternative of course is to use Notepad2.
- Script Center Script Repository: Why write scripts when you can steal (er, borrow) them from the Script Center? The Script Repository contains hundreds and hundreds of scripts you can either use as-is or customize to meet your needs. You can even download the entire repository as a CHM (Help) file so you can browse it offline!
- System Administration Scripting Virtual Lab: Use this online lab to try out real-world scripting scenarios. This site is great if you feel you're still a beginner and need help getting going.
- Community-Submitted Scripts Center: Have you written a script that you'd like to share with others? You can do so (and read what others have shared) at the Community-Submitted Scripts Center. Get involved today!
- Dr. Scripto's Fun Zone contains crossword puzzles, scripting games, comic strips -- everything you need to lighten up, release stress and get into learning mode so you can learn to script.
I hope you've enjoyed this series of articles as much as I've enjoyed writing them. I'll visit the topic of scripting again in the future sometime, but for now if you want to learn more, then buy one or two of the books I've listed above and start getting familiar with the Script Center on TechNet. You can get over that hump if you try! Good luck!
About the author:
Mitch Tulloch is a writer, trainer and consultant specializing in Windows server operating systems, IIS administration, network troubleshooting, and security. He is the author of 15 books including the Microsoft Encyclopedia of Networking (Microsoft Press), the Microsoft Encyclopedia of Security (Microsoft Press), Windows Server Hacks (O'Reilly), Windows Server 2003 in a Nutshell (O'Reilly), Windows 2000 Administration in a Nutshell (O'Reilly), and IIS 6 Administration (Osborne/McGraw-Hill). Mitch is based in Winnipeg, Canada, and you can find more information about his books at his website: www.mtit.com.
WindowsNetworking.com contains a wealth of networking information for administrators: Featuring information on how to setup and troubleshoot various networks of any size. Also includes a comprehensive archive of hundreds of reviewed networking software and hardware solutions. Frequently updated with articles and tips by a team of leading authors, it remains a favorite within the networking community.