Windows Management Scripts
Scripting Windows Management is one of those good ideas that you might not have gotten around to trying yet. Perhaps you're not sure what you could accomplish with a script that you can't accomplish from the graphical interface.
ActiveXperts Network Monitor has full support for scripting Windows Management. There are already thousands of documents on the Internet and hundreds of good books about scripting Windows Management. However, there's a lack of good, easy to use samples. We provide a nice set of samples, that you can easily use inside ActiveXperts Network Monitor. The most important Windows management scripting technologies are:
- ADSI - Active Directory Services interfaces
- PowerShell - Windows' next genetation scripting language
- VBScript (Visual Basic Script) - A huge list of VBscripts
- WMI (Windows Management Instrumentation) - List of WMI classes with scripts in different scripting language
- WMI (Performance Counters) - List of WMI Performance Counters classes with scripts in different scripting language
- WSH (Windows Scripting Host) and VBScript
Active Directory Services interfaces (ADSI)
Active Directory Service Interfaces (ADSI) enable system administrators and developers of scripts or applications to easily query for and manipulate directory service objects.
ADSI present a single set of directory service interfaces for managing network resources from different directory services. Administrators and developers can use ADSI to manage the resources in a directory service, regardless of which network environment contains the resource.
Scripts written to ADSI will work with any directory service that offers an ADSI provider. For example, with ADSI, applications can access LDAP, NDS, the Active Directory service, and other directories with ADSI interfaces as long as the appropriate service providers are available.
The standard ADSI providers are found within multiple namespaces - typically directory services for various network operating systems. Providers enable communication between the server or client. ADSI includes providers for:
- Windows Server platforms.
- Windows Desktop platforms.
- Windows Active Directory.
- Lightweight Directory Access Protocol (LDAP).
- Novell NetWare Directory Services (NDS), and NetWare 3 bindery (NWCOMPAT).
ActiveXperts Network Monitor provides the ability to build monitor check routines based on ADSI. ActiveXperts Network Monitor provides some useful ADSI scripts. You can use these samples as a base for new check routines you can write yourself.
Windows PowerShell is an important Windows management tool, together with VBScript. PowerShell's scripting environment consists of a command shell and a scripting language. You can write PowerShell scripts yourself using your favorite text editor, to run them in the PowerShell command shell.
PowerShell includes cmdlets to all sorts of system actions, from navigation and management to accessing resources. You can execute all of the cmdlets from the PowerShell command line or in your scripts. For a list of all available cmdlets, use the get-command command.
Visual Basic Script (VBScript)
VBScript (short for Visual Basic Scripting Edition) is an Active Scripting language, developed by Microsoft, which uses the Component Object Model to access elements of the environment within which it is running. The language's syntax reflects its origins as a limited variation of Microsoft's Visual Basic programming language.
ActiveXperts Network Monitor has full support for scripting Windows Management. Click here for more than thousand VBScript samples for IT administrators. You can easily use these scripts in ActiveXperts Network Monitor.
VBScript has been installed by default in every desktop release of Microsoft Windows since Windows 98; as part of Windows Server since Windows NT 4.0 Option Pack; and optionally with Windows CE (depending on the device it is installed on).
Windows Management Instrumentation (WMI)
The foundations for Manageability in Windows XP/Windows 2000 and Windows Millennium Edition/Windows 98 are Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).
The purpose of WMI is to define a non-proprietary set of environment-independent specifications. These specifications allow management information to be shared between management applications that run in both similar and dissimilar operating system environments. WMI prescribes enterprise management standards and related technologies that work with existing management standards, such as Desktop Management Interface (DMI) and SNMP. WMI complements these other standards by providing a uniform model. This model represents the managed environment through which management data from any source can be accessed in a common way.
ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts Software has collected more than hundred WMI samples. You can use these samples as a base for new check routines you can write yourself.
WMI - Performance Counters
The foundations for Manageability in all versions of Windows after Windows '98 are Windows Management Instrumentation (WMI;formerly WBEM) and WMI extensions for Windows Driver Model (WDM).
Windows Scripting Host (WSH) and VBScript
VBScript (Microsoft Visual Basic Scripting Edition) is often dismissed as being "just" a scripting language, the implication being that a scripting language is of little use to a system administrator faced with managing hundreds or even thousands of computers in an enterprise setting. However, when used in combination with technologies such as Windows Script Host (WSH), Windows Management Instrumentation (WMI), and Active Directory Service Interfaces (ASDI), VBScript becomes a powerful language for system- and network administration purposes. For example, the three-line script below tells you how much free disk space is available on drive C of your computer:
Set objWMIService = GetObject("winmgmts:") Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'") Wscript.Echo objLogicalDisk.FreeSpace