VBScript - For Windows Networks
Introduction to VBScript
This section provides you with free tutorials of VBScripts for Windows Server and XP and Windows 7/8. 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.
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:
Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft's operating systems. Fortunately, SolarWinds have created a Free WMI Monitor so that you can discover these gems of performance information, and thus improve your scripts.
Take the guess work out of which WMI counters to use when scripting the operating system, Active Directory or Exchange Server. Give this WMI monitor a try - it's free.
Why Script WMI with VBSCript?
One application for writing WMI is scripts is for hardware inventories. For example, how many of our computers chassis are Desktops and how many are 'Pizza Boxes'? What are the cooling fans' specifications on the servers? Who are the disk manufacturers of our servers in the Worcester office?
For this and similar tasks, WMI has dozens of objects and hundreds of methods here are three examples:
General Scripting Techniques
Each script has two missions:
Encouraging computers to sleep when they're not in use is a great idea - until you are away from your desk and need a file on that remote sleeping machine!
WOL also has business uses for example, rousing machines so that they can have update patches applied. My real reason for recommending you download this free tool is because it's so much fun sending those 'Magic Packets'. Give WOL a try - it's free.
VBScript in Windows Server 2003/8 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.
Windows Management Instrumentation (WMI) is most useful for PowerShell scripting.
SolarWinds have produced this Free WMI Monitor to take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.
Author: Guy Thomas Copyright © 1999-2014 Computer Performance LTD All rights reserved.
Please report a broken link, or an error to: