Problem with WMI.

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Gaurav (gaurav081_at_yahoo.co.in)
Date: 06/03/04


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



Relevant Pages

  • Re: WMI Service Cannot Connect
    ... It looks like only my script on the remote machine ... > command prompt though; closes when done). ... Can you post us the link, that we can get the script too? ... For test proposals try to use the "Administrator". ...
    (microsoft.public.win32.programmer.wmi)
  • Re: change password w2k
    ... > If you are an administrator of the remote machine, ... you can modify the script and use a connection with ...
    (microsoft.public.windows.server.scripting)
  • Re: printuientry
    ... you could put it into a logon script. ... The error did not occur as a network administrator. ... I've tried several variations on the command syntax and can not get it ... >> printer is already defined on a "local port", ...
    (microsoft.public.win2000.printing)
  • Re: Domain Users to have Local Admin rights
    ... make sure that your script works. ... this computer as local administrator and insert USB drive. ... startup script (e.g. OU policy or Default Domain Group Policy). ... Now close this windows and click on ...
    (microsoft.public.windows.server.security)
  • Re: yet another question on file names with spaces?
    ... > I agree, the echo is redudant. ... > know what they are before the script runs - see below. ... > finding whether they are also on the remote machine. ... > images and pdfs which I only want to transfer once. ...
    (comp.unix.shell)