Monday, November 9, 2009

VB Scripting N00b

Back when I was in college, a few years back, I studied a lot of computer programming (C, C++, Java, and yes, COBOL!) but I decided to work in tech support and later systems administration. With the kind of work I've had to do, I will have to admit that my coding skills are rather rusty. Due to some changes in my job, I have come to the realization that I really have to work on my scripting skills.

In the Windows world, I understand that it is preferable to learn Powershell and not bother with VBScript if you aren't really familiar with a scripting language. However, I have a task that I want to accomplish and all the client computers are running Windows XP. It's impractical to install Powershell on hundreds of XP clients just to run a script! Therefore, I will be working with VBScript.

I have decided to use Notepad++ as my editor, and have been reading VBScript, WMI, and ADSI Unleashed: Using VBScript, WMI, and ADSI to Automate Windows® Administration, Second Edition by Don Jones.

What is my main task? I would like to add three IP addresses to the list of WINS servers for the active ethernet adapter on a computer. Once the WINS servers are set, I have another .vbs script I would like to run, calling on a third-party program. I have already tried doing this using a batch file with a netsh command, but my concern is that the active network adapter won't always be "Local Area Connection" and I want the end user to be exposed to as few errors as possible. The Win32_NetworkAdapterConfiguration WMI class looks like it has some promise, but right now I'm not totally sure how to make it work for me. I guess I have some more reading to do!

No comments:

Post a Comment