Discussion:
Enumerating W32_UserAccount classes
(too old to reply)
Andrew
2010-04-27 15:37:02 UTC
Permalink
I'm trying to find all users (and their SID's) who have logged onto a domain
workstation. Currently I'm using the WQL query:

ASSOCIATORS OF {Win32_ComputerSystem.Name='" + NBiosName + "'} WHERE
AssocClass=Win32_SystemUsers ResultClass=Win32_UserAccount
Role=GroupComponent ResultRole=PartComponent

On my computer I can see all the local and domain accounts that have at one
time or another logged on. On multiple remote computers I am only seeing
local profiles. Yet when I open up the WMI Object Browser and connect to the
remote machine I see all local and domain accounts listed under the
Win32_UserAccount container. Though the domain accounts are seen by the WMI
Object Browser, if I click on them I get a 'WMI: Not found' pop-up. Is there
perhaps a better way to obtain this information? If not, how do I fix this?
Any help is very much appreciated.

WMI Object Browser -
http://www.microsoft.com/downloads/details.aspx?familyid=6430f853-1120-48db-8cc5-f2abdc3ed314&displaylang=en
Gerry Hickman
2010-05-07 21:52:58 UTC
Permalink
Post by Andrew
I'm trying to find all users (and their SID's) who have logged onto a domain
Hello,

I think you may be seeing behavior related to my thread here:

<http://groups.google.com/group/microsoft.public.win32.programmer.wmi/browse_thread/thread/af99cf7a6719efc6/f3ccafaeccd566a6?#f3ccafaeccd566a6>
Post by Andrew
ASSOCIATORS OF {Win32_ComputerSystem.Name='" + NBiosName + "'} WHERE
AssocClass=Win32_SystemUsers ResultClass=Win32_UserAccount
Role=GroupComponent ResultRole=PartComponent
On my computer I can see all the local and domain accounts that have at one
time or another logged on. On multiple remote computers I am only seeing
local profiles. Yet when I open up the WMI Object Browser and connect to the
remote machine I see all local and domain accounts listed under the
Win32_UserAccount container. Though the domain accounts are seen by the WMI
Object Browser, if I click on them I get a 'WMI: Not found' pop-up. Is there
perhaps a better way to obtain this information? If not, how do I fix this?
Any help is very much appreciated.
WMI Object Browser -
http://www.microsoft.com/downloads/details.aspx?familyid=6430f853-1120-48db-8cc5-f2abdc3ed314&displaylang=en
--
Gerry Hickman (London UK)
Loading...