Computer Performance, Windows 2003, Logon Scripts

Google

WebSearch Site

 Home
Subscribe to Newsletter
WSH - Home
WSH - Simple Script
WSH - Create User
WSH - Bulk Import
WSH - Create Group
WSH - Create Contact
WSH - FSO Create File
WSH - List Members
WSH - Error Messages
VBScript Home
Logon Script Home
CSVDE & LDIFDE
 LDAP Attributes

 

 More Sections
 Guy's eBooks
 Windows 2003
 Exchange 2003 (New)
 Performance Monitor

 

 Windows 2000 AD
 Exchange 2000
 SQL Server 2000
 SharePoint Portal

 

 Litmus Tests
 Registry Hacks
 Problem Solving
 On-line advice
 Free ebooks

 

Contact Guy
About Us
Online Jobs at CP
Guy's eBooks

 

 

WSH - Home

Introduction to WSH (Windows Scripting Host)

The key word in understanding WSH is Host.  WSH (Windows Scripting Host) provides the environment to run scripts like VBScript or JScript.  This is a big improvement over running .bat files in the CMD/DOS 'host'.  Another analogy is the way Internet Explorer acts as a 'host' for displaying Dynamic HTML.

The more you learn about WSH, the more you realize how versatile this host is.  For starters, it supports not only VBScript, but also JScript, Perl, Rexx and Python.  WSH leverages objects and methods from WMI (Windows Management Instrumentation) and ADSI (Active Directory Service Interface).

The secret of WSH, like any good host, is the ability to look after its guests; in this case to service WMI and ADSI requests.  In practical terms, it means that you creating scripts which interact with the Windows Server operating system.

VBScript (or other scripting language)

If WSH is the host or container, then think of VBScript as the glue.  What actually happens is VBScript attaches to ADSI and then pastes the user object into the script.

WSH in action

  • Logon Scripts - Mapping network drives (Native WSH)
  • Creating Active Directory objects - Bulk import of users (Using ADSI)
  • Collecting operating system data - Memory, uptime or free disk space (WMI)
  • Starting or Stopping services - Telnet, System Attendant or Netlogon (WMI)

CScript.exe and WScript.exe

These are the actual executables that perform all the WSH tasks.  Mostly I use the command line CScript.  The latest version of CScript is 5.6, this is built-in to Windows Server 2003.  Windows 2003 ships with version 2.0 but this is upgraded to the 5.6 version when you install Service Pack 3 or later. 

You can check out either CScript or WScript by simply running either at the CMD prompt.  Also investigate file type association to make the connection between .vbs extensions and CScript.exe (Windows Scripting Host).

˚

 


See Also

 *


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-2009 Computer Performance LTD All rights reserved

Please report a broken link, or an error.