Hi,
I am trying to run the following program in a Windows 2000 machine.I am getting the error as " Microsoft VBScript runtime error: Permission denied: 'GetObject'".Please suggest me something.
Option Explicit
Dim refWMIService
Dim objComputer
Dim colComputer
'get a reference to the SWbemServices object
set refWMIService = GetObject("winMgmts:\\ipaddress")
Set colComputer = refWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
Wscript.Echo objComputer.UserName
Next
The purpose of the above program is to output the logged on user for the computer being queried.
Bookmarks