Problem with WMI.
From: Gaurav (gaurav081_at_yahoo.co.in)
Date: 06/03/04
- Next message: Bob Barrows [MVP]: "Re: how to add an element to an object"
- Previous message: Ben: "how to add an element to an object"
- Next in thread: Roland Hall: "Re: Problem with WMI."
- Reply: Roland Hall: "Re: Problem with WMI."
- Reply: Roland Hall: "Re: Problem with WMI."
- Messages sorted by: [ date ] [ thread ]
Date: 3 Jun 2004 07:05:21 -0700
Dear All,
I am running a script to get the logged on user on a remote machine
but its not working.
I'm sitting on a Domain Controller logged on as administrator of the
domain and running the script.The script runs fine when domain
administrator is logged on to remote machine. But if a normal user is
logged on it gives nothin as output.
Pls tell me what is the reason behind it and how to solve it.
Thanks in advance
Gaurav
Here goes my script......
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strServer &
"\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
a = objComputer.UserName
wscript.echo a
Next
- Next message: Bob Barrows [MVP]: "Re: how to add an element to an object"
- Previous message: Ben: "how to add an element to an object"
- Next in thread: Roland Hall: "Re: Problem with WMI."
- Reply: Roland Hall: "Re: Problem with WMI."
- Reply: Roland Hall: "Re: Problem with WMI."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|