Hi,
I have been using the following script for a while.
strComputer = "Computername"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
sonate}!\\
" & strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
Wscript.Echo objComputer.UserName
Next
The script outputs the logged on user for the computer being queried.
The network is entirely windows 2000 Servers and clients. I am logged on as a domain admin
The script worked previously but has now stopped working for remote clients.
I get the error VBScript runtime error: 800A0046 Permission denied: 'GetObject'" when I query a remote client.
It still works on the Local Client.
I suspect it is a permissions problem but I have no idea why.
Can anyone help with this one?
Many Thanks
DenisBS
Start Free Trial