Win32_ComputerSystem
- From: "Bart Perrier" <bart_perrier@xxxxxxxxxxx>
- Date: Tue, 28 Jun 2005 16:11:52 -0500
I am using the Win32_ComputerSystem Class to retrieve the currently logged
in user of a workstation. I have other tools that retrieve this information
but am migrating to an HTA for common network tasks; this being one of them.
My issue is that many workstations are returning "No User Logged In". So far
the only machines I have seen this on are 2000 Professional and I am certain
that a user is logged in. The WMI version is 1085.0005 but I have other 2000
Server machines with 1085.0005 that I am successful in retrieving the logged
in user.
Should I be using a different class to get more reliability?
Thanks.
Bart Perrier
' create WMIService connection to strComputer
Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
If ErrorConnecting(strComputer) = False Then
Set colLoggedInUser = objWMIService.ExecQuery _
("SELECT * FROM Win32_ComputerSystem ")
For Each objLoggedInUser In colLoggedInUser
strHTML = strHTML & objLoggedInUser.username & "<br>"
If IsNull(objLoggedInUser.username) Then
strHTML = "No User Logged In"
End If
Next
DataArea1.InnerHTML = strHTML
End If
.
- Follow-Ups:
- Re: Win32_ComputerSystem
- From: Ato Bisda
- Re: Win32_ComputerSystem
- Prev by Date: Placing URL stored in variable into IE
- Next by Date: Re: vbs error 800a09b6
- Previous by thread: Placing URL stored in variable into IE
- Next by thread: Re: Win32_ComputerSystem
- Index(es):
Relevant Pages
|