Managing Windows Networks Using Scripts – Part 14: Learning More about WMI Scripting

If you would like to read the other parts in this article series please go to:

By now if you’ve been patiently following along with me through the previous thirteen articles in this 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 things that are essential for successful WMI scripting:

  • Understanding basic WMI scripting concepts such as classes objects, properties and methods (see article 1)
  • How to write proper code by defining variables, handling errors, input/output and commenting (see article 2).
  • Understanding WMI namespaces, providers and classes and how to use MSDN to learn how to use a particular WMI class (see article 3 and 4)
  • How to work with remote scripting and troubleshoot issues that might arise (see articles 6 through 10).
  • How to retrieve system and network settings by enumerating the properties of a WMI class instance (articles 12 and 13)


Get the Windows Vista Resource Kit today!

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 (or perhaps until earth warms due to global warming, that is, depending on your take on the subject). But my goal with this series of articles was basically just to get you up and running by showing you some basics, 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?

Anyway, 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 performing 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, lol.

Script Center

THE 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 and it can be daunting for newcomers to find there 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. 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 (alas poor Fortran, I knew him well). Of course if you prefer to learn things systematically (or 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) and you can find more up to date information about WMI on MSDN (though MSDN too is sometimes out of date or contains errors—oh well).
  • Tales from the Script (eeek!). Miscellaneous and often quite funny articles on various scripting topics, a bit more advanced sometimes and definitely worth a look (boo!).
  • Hey, Scripting Guy! Literally a ton of useful short question and answer articles here 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 are real human beings (in case you were wondering).
  • Scripting Tools and Utilities. Sometimes Notepad just doesn’t cut it for writing scripts, and 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—cool!
  • System Administration Scripting Virtual Lab. Use this online lab to try out real-world scripting scenarios. 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. 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.

Conclusion

Well 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!

If you would like to read the other parts in this article series please go to:

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top