Meditech NPR Reports / NPR Report Writing / NPR Report Writer / Meditech NPR / Non-Procedural Report / Meditech Consulting / Meditech Reports Windows Scripting: Spawning Remote WMI on Windows NT

Monday, March 20, 2006

Spawning Remote WMI on Windows NT

' Purpose: Load ODBC Connection on Windows NT Class Machines.
' Author: John Sharpe on 03/20/2006
' Script Engine: VBS

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

' Build computer list: "comp1","comp2", etc...
arrComputers = Array("SQLSERVER","EMAILSERVER")

For Each strComputer In arrComputers
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
' Update ODBC connection using regedit.
strCommand = "regedit /s \\sqlserver\scripts\Odbc.reg"
' Execute remote process.
' You must have administrative rights to spawn a remote process.
errReturn = objWMIService.Create(strCommand, Null, Null, intProcessID)
Next

0 Comments:

Post a Comment

<< Home

Meditech NPR Reports / NPR Report Writing / NPR Report Writer / Meditech NPR / Non-Procedural Report / Meditech Consulting / Meditech Reports