Listing User Accounts With WMI

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello,

I am trying to list the accounts on a machine with WMI. When I use
the following query:
SELECT * FROM Win32_UserAccount
the results apppear to be all those on the same domain as the computer
I am connected to. I then tried the following query:
SELECT * FROM Win32_UserAccount WHERE LocalAccount = True
This time, the results returned very quickly and appear to be only
local accounts; however, I then tried to list the details for a
specific user using the following:
SELECT * FROM Win32_UserAccount WHERE LocalAccount = True AND Name =
"Administrator"
and the results return extremely slowly (as if it were talking to the
domain controller again). How can I query for the information on a
specific user on a machine and have the results returned quickly?

I have been using wbemtest.exe for testing the queries.

Thanks.

.



Relevant Pages

  • Re: Query for last workstation log-in
    ... In 2K you would have to query every domain controller in the domain for every ... You can also use it to clean up user accounts as well if you use the -f option ... Arc J. Thames wrote: ...
    (microsoft.public.win2000.active_directory)
  • Re: Problem with Code Because I already have an Open Query
    ... FROM [RESPEL ALL CHARGES] INNER JOIN RESERVATIONS ON [RESPEL ALL ... The too few parameters error means the query is missing values for 3 ... I use a QUERYcalled "ACCOUNTS" because it takes data from different ... Now from there I use a Form "ACCOUNTS SEARCH" with a SubForm to filter ...
    (microsoft.public.access.forms)
  • Re: Problem with Code Because I already have an Open Query
    ... Make a copy of the Accounts query to work with call it qryAccountsCopy. ... FROM [RESPEL ALL CHARGES] INNER JOIN RESERVATIONS ON [RESPEL ALL ...
    (microsoft.public.access.forms)
  • Re: Problem with Code Because I already have an Open Query
    ... Make a copy of the Accounts query to work with call it qryAccountsCopy. ... FROM [RESPEL ALL CHARGES] INNER JOIN RESERVATIONS ON [RESPEL ALL ...
    (microsoft.public.access.forms)
  • Re: Problem with Code Because I already have an Open Query
    ... Make a copy of the Accounts query to work with call it qryAccountsCopy. ... FROM [RESPEL ALL CHARGES] INNER JOIN RESERVATIONS ON [RESPEL ALL ...
    (microsoft.public.access.forms)