Win32_ComputerSystem



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


.



Relevant Pages

  • Re: Re-install XP w/SP2
    ... The workstation works OK, it has a few issues, the main ... format and install Windows onto the new hard drive will MicroSoft ... news groups and Knowledge base is a little like trying to find a ... To try and retrieve the key, does anyone else have a suggestion? ...
    (microsoft.public.windowsxp.general)
  • Re-install XP w/SP2
    ... because the workstation I built two years ago needs a new hard drive. ... install Windows onto the new hard drive will MicroSoft think I am trying to ... For me trying to wade through the news groups and ... To try and retrieve the key, does anyone else have a suggestion? ...
    (microsoft.public.windowsxp.general)
  • Re: Question on NTCONFIG.POL
    ... using the NTCONFIG.POL and placed under every Domain Controller. ... can I place the NTCONFIG.POL under Win2K3 DC and the workstation also ... retrieve this Policy Set? ...
    (microsoft.public.windows.group_policy)
  • Forgot password option for users (process)
    ... for users when attempting to login to a workstation. ... valid info to retrieve a new password or to display the current password. ... My questions are what are the best practices in regards to this and where ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Win32_ComputerSystem
    ... Look up the last logged-in user entry in the remote computer's registry. ... > in user of a workstation. ... I have other tools that retrieve this information ... > Server machines with 1085.0005 that I am successful in retrieving the logged ...
    (microsoft.public.scripting.vbscript)