Computer Performance, VBScript

 

VBScript - For Windows Networks

Introduction to VBScript

This section provides you with free tutorials of VBScripts for Windows Server 2003 and XP.  Many of the scripts are designed to create and manipulate Windows Active Directory objects.  Each page has a tutorial explaining the methods you need to tackle a particular every-day network task.  In addition to the scripts themselves, I provide learning points to explain how the VBScript builds objects such as Users, Computers and Groups.

Please treat this page as a mini sitemap for free VBScript examples.

VBScript Sections

Windows Server 2003 Active Directory Example Scripts

 ♦

Creating and Controlling Files with FSO (Scripting.FileSystemObject)

Registry

  • RegRead - Introduction to RegRead
  • RegRead - Read the Registry Advanced

WMI (Windows Management Interface)

WMI gives you the power to automatically collect hardware and software data.  View WMI as a pipe connecting magically to the secret inner cave of the Microsoft operating system.  This is a section for techies who want VBScripts to remotely control of their Windows networks.  Study root\cimv2 here:

 

 

Solarwinds LANSurveyorGuy Recommends: A Free tool from SolarWinds: Config Generator

Config Generator (CG) is a free tool, which puts you in charge of controlling changes to network routers and other SNMP devices.  Boost your network performance by activating network device features you've already paid for.

Guy says that for newbies the biggest benefit of this free tool is that it will provide the impetus for you to learn more about configuring the SNMP service with its 'Traps' and 'Communities'.  This is a brand new free utility which Solarwinds released on January 26th 2010.

Download your free copy of the Config Generator

General Scripting Techniques

Each script has two missions:
a) A practical task that reveals properties of the Windows operating system.
b) A theoretical technique to demonstrate a pure VBScript command.

 

  • Binding to Active Directory
  • Object based model
  • Writing to files with FSO
  • Select Case
  • For ... Next loops
  • If ... then Else ..  End if logic
 
  • error-correcting code
  • On Error Resume Next
  • WScript.Echo
  • InputBox

VBScript Background

VBScript in Windows Server 2003 conforms to the classic Object programming model.  Objects such as Users have properties for example 'givenName' and 'description'.  The most interesting part is the methods because they are used to manipulate the object, for instance, GetObject, CreateObject and ConnectObject.  More often than not, the goal of our script is to set a value for a particular properties, for example Object = User, Property = givenName, Value = Guy.

It can be hard to pin down VBScript.  There are no stand-alone executables, you do not compile VBScript as you would with C++.  How does it work, I can hear you asking.  Well VBScript works through a host WSH which reads plain scripts, compiles them and runs them.  This means what ever is in those scripts is what gets done.

Example VBScript to create a user with a first name (givenName) of Guy.

VBS Learning Points

Note 1: This is just an example of VBScript.  It illustrates the Object, Property and Value structure.  It creates a User object (not a computer object).  This example assigns the property givenName a value = "Guy".

ˇ

Next Step

Site Home   Creating Users      Creating Folders    WMI - Basics

 


Introduction to VBScriptDownload my eBook:  Introduction to VBScript - only  $6.25

25+ scripts to get you started with VBScript.  Topics include Active Directory, Network, WMI, File System Object and the Registry.

In addition to the ebook, you get a PDF and a Word version of Introduction to VBScript.

 

 

 

 *


Google

Web  This website

Review of Orion NPMGuy Recommends: Orion's Network Performance Monitor (NPM)

Orion NPM is designed for detecting network outages.

Network-centric views (screenshot) make it easy to see what's working, and what needs your attention.

Download your free trial of Orion's network performance monitor

 

Home Copyright © 1999-2010 Computer Performance LTD All rights reserved

Please report a broken link, or an error.