When running this script the objComputer.UserName value is empty

Option Explicit
Dim objWMIService, objComputer, colComputer, strComputer

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer in colComputer
Wscript.Echo objComputer.UserName & " is logged on"
Next

Re: objComputer.UserName value is empty by Al

Al
Mon Oct 22 16:55:44 PDT 2007


"Gert Albertse" <gjja@sun.ac.za> wrote in message
news:1193043478.136504.14550@z24g2000prh.googlegroups.com...
> When running this script the objComputer.UserName value is empty

Do you have a question, or are you just making a comment?

/Al

> Option Explicit
> Dim objWMIService, objComputer, colComputer, strComputer
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" _
> & strComputer & "\root\cimv2")
> Set colComputer = objWMIService.ExecQuery _
> ("Select * from Win32_ComputerSystem")
>
> For Each objComputer in colComputer
> Wscript.Echo objComputer.UserName & " is logged on"
> Next
>