"Gert Albertse"
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
>