Fog Creek Software
Discussion Board




VB Script for Remote Workstation Admin tasks?

Hi,

I am working in a department for a local government. My section provides tech support for about 1,500 workstations, mostly running Win NT Workstation. All machines are under a Win Server Domain.

I had just joined the section last month, and my colleagues are doing lots of admin tasks (things like copying files to the remote workstations and executing programs there to do installs) using DOS batch files. Batch files are very crude tools, and my colleagues' programming skills are somewhat modest. I am looking into a superior tool to work with, and have done some research on this. It seems that using VB Script under Windows Script Host (WSH) seems to be the best alternative.

Has anyone here had any experience using VB Scripting to do workstation/network admin tasks? Would you recommend this tool? Or suggest a better one? I am not so interested in preformance; mostly I want something closer to a modern programming language with features that are lacking in DOS batch files - error handing, decent editor that catches syntax errors, modular programming, etc.

Harlequin

Harlequin
Monday, June 02, 2003

There are security issues with WSH, you might not worry about them in your particular environment, if all the machines are protected by a reasonable firewall for example.

If it does bother you, then I'd suggest using either perl or python instead, or if you want lots of shell grunt with security run cygwin and have rsh scripts.

Simon Lucy
Monday, June 02, 2003

At the Microsoft TechNet Script Center, there is a large collection of sample administration, networking, etc scripts designed to run on Windows 2000, Windows XP, and Windows Server 2003.
http://www.microsoft.com/technet/scriptcenter/default.asp

Also see the answers to common questions about scripting for these types of tasks at:
http://www.microsoft.com/technet/scriptcenter/scrptfaq.asp

Philip Dickerson
Monday, June 02, 2003

Note - many (not all) of the scripts at the site mentioned in my previous entry will also run on Windows NT, but you may need to install the latest version of WSH/VBScript and possibly also WMI and/or ADSI on the Windows NT systems.

Philip Dickerson
Monday, June 02, 2003

Won't you have to go round all 1.500 workstations to check that WSH is installed and has not been turned off (and turning it off as a security measure has been recommended in the press loads of times).

Is there any need for it. Your colleagues' programming skills may be basic, but they are sysadmins, not programmers.

Is there ahy need for what you're doing? Are you sure you're not an aspirant to be a programmer who has taken up a sysadmin job because of the recession.

I'd certainly do a complete security audit before tuirning WSH on.

Stephen Jones
Tuesday, June 03, 2003

Steven,

Of course there is a need to do it, otherwise I would not have posted my question in this forum. It is because my colleagues are sysadmins and not programmers that they likely do not realise fully how crude DOS batch files are compared to more modern programming enviornments.

You do make a good point about security, and I will certainly bring it to my boss' attention. Actually, I was just reading up on how to deal with this - you simply modify the registered file type to open the script rather than execute it. This will prevent a script virus from executing or a user from accidentally starting the script.

Harlequin

P.S. I'll bet you I am not the only programmer who had been forced to take a sysadmin job because of the recession. But every cloud has a silver lining; some of my colleagues are pretty sharp, and I expect to learn some useful things from them.

harlequin
Tuesday, June 03, 2003

I thought one of the problems of WSH was that script that escaped from the sandbox could be run.

If your script is not going to run but be opened (whatever that is) how is it going to work?

You are still talking about need from a programmer's perspective. What will your VB scripts do that the old batch files won't?

Stephen Jones
Tuesday, June 03, 2003

harlequin,

Whats wrong with crude? If it works 100% of the time and never causes any problems you should not try to change it.

Only if it doesn't work 100% of the time should you rewrite the program. Sys admin is not the same as development. The aim is to keep machines working and in a usable state. If things work and aren't causing problems elsewhere no sane sysadmin will change a working solution.

Ben Thompson
Tuesday, June 03, 2003

Ben,

The problem is my colleagues write DOS batch files very much on the fly without much of any documentation or testing, and they work far less than 100% of the time.

What I had in mind was to use a more modern scripting language to produce a set of 'template' programs to perform common admin tasks. If I documented them well and explained to my colleagues how to modify them, I think in the long run they would serve us far better than batch files. In addition, a modern scripting language (like VB Script) would offer the possibility of doing more complex and sophisticated admin tasks than could be achieved doing batch files.

Harlequin

harlequin
Wednesday, June 04, 2003

*  Recent Topics

*  Fog Creek Home