When learning to script for managing Windows networks, you need to be aware of a bump in the road Mitch Tulloch calls "the hump." Learn how to get over the hump in this tip, originally published on WindowsNetworking.com.
In the previous article in this series we started exploring what we could do with the Win32_NetworkAdapterConfiguration class. This powerful WMI class has 61 properties and 41 methods that can be used for retrieving and changing TCP/IP networking settings on Windows computers.
To illustrate the power of this class, we took the sample script we developed in the first and second articles, and using information about this class on MSDN, we customized our original script to make it do something different. Specifically, we took a script that changed the IP address of a network adapter and customized it to come up with a new script that disables NetBIOS over TCP/IP (NetBT) on all network adapters that have TCP/IP bound and enabled on them.
We need to explore this powerful WMI class further, and we're going to do so in several future articles. But before we do this, let's talk about "the hump."
The hump
After I began this series of articles on how to manage Windows networks using scripts, I started to get emails from readers. Most of these emails involved readers asking a simple question: "How can I learn to script?" My initial reaction is usually to point the questioner to a variety of resources including articles on TechNet, different books, scripting newsgroups, and so on. Of course, when I think about it, that's like saying to someone who asks you how to become an expert in French cooking, "Here are some addresses of different cooking schools, titles of cookbooks, and websites. Go, start learning." That kind of answer may be helpful to those who have the initiative and self-discipline to learn a skill themselves, but it poses another question that's more interesting: Why do some of us have difficulty learning a s
To continue reading for free, register below or login
To read more you must become a member of SearchNetworking.com
');
// -->

kill in the first place?
I tried to become a gourmet cook once, and here's how I went about it:
What was the result of all this? Soup all over the place, on the stovetop, on the walls, on the ceiling. And dirty pots and pans piled sky high. I didn't get lucky either -- it didn't taste all that great, either to my friends or to me. What went wrong? A lot of things. Specifically:
What kind of approach should I have followed instead of the one I used?
What does this have to do with learning to script? Well first of all, a little humor like this puts you in the mood to to listen, and now that I have your ear maybe you'll hear what I have to say. Almost every Windows administrator who wants to learn how to script usually hits a big bump in the road along the way, which I'll call "the hump." This hump appears when the brain starts to shut down because there are just too many concepts to absorb easily. This is because concepts don't exist in a vacuum, they are interrelated. For example, you can't really understand what a Property is unless you also grasp what a Method is. And both Properties and Methods are only understood in the context of Classes. And Classes must be Instantiated into Objects before they can have Properties and Methods, or more properly, Object References to the Instance of a Class have Properties and Methods you can read and manipulate. Sounds like gobbledygook, doesn't it? Well, that's because it is gobbledybook!
"Why can't I just learn to script? Why do I have to learn all these concepts and terminology?" Well, why do you have to learn the difference between a white sauce and brown sauce? Or know that sauces come in four basic types: purees, reductions, starch-bound and emulsions? Or that roux forms the basis for bechamel, veloute, etouffe and both white and brown sauce? And why do I need to understand the history of bechamel? Because in the long run you won't get anywhere unless you learn these basic concepts, as they (and many others) form the basis of most French cooking.
On the other hand, most of us in the real world (i.e. those of us who don't want to become professional chefs) don't have the time, money or patience to attend a French cooking school full time and spend the first six months making basic sauces again and again before we are taught how to fry a pork chop. I know I would get bored silly after only a few weeks and decide I better find a different career. It's the same with learning to script: As a busy network admin, I just can't spend three years learning every Property and Method associated with every WMI class that has anything to do with Windows networking. Or learn every aspect of the syntax of the VBScript language to become totally proficient in it. I had enough of that learning Fortran back in my freshman university days, writing program after program to print out the first ten squares, the first 100 primes, the first thousand Fibonacci numbers, and so on and so on. So given our limited time, money and patience, coupled with the intrinsic difficulty of learning the vast number of interrelated concepts involved in Windows scripting, how can ordinary administrators like us get over the hump and learn to script -- and do it usefully?
Getting over the hump
Clearly there's no magic answer to this question, but there are some things I've found helpful. Here's what's helped me:
Conclusion
I wrote this article because I sensed from some readers that they were already approaching the hump after only four articles. Hopefully what I've said here will help you overcome whatever is holding you back from really learning this stuff. In my next article, we'll return to exploring the Win32_NetworkAdapter Configuration class and see what we can do with it, and along the way we'll learn new concepts and reinforce ones previously introduced. We'll also learn additional bits and pieces of the VBScript syntax and see how we can make our scripts more elegant and useful. And then we'll explore some other WMI classes and eventually some advanced scripting topics like alternate credentials, remote scripting, COM objects, WSF scripts, and so on. We'll eventually tap into a few tools useful for writing scripts, but it's important to learn the basics first before you learn the shortcuts as it gives you a much deeper understanding of the subject and therefore more confidence in your skills. I'll also try to give you some exercises to complete on your own, and if you really want to learn to script, you need to do them and not just look at them and say "I can do that." After all, practice does make perfect. And finally, feel free as always to email me if you have any questions or suggestions concerning this series of articles. 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.
[TABLE]
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.