Re: WMI Win32_UserAccount query

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



spear.light@xxxxxxxxxxx wrote:

I have a Windows 2003 workstation in a Windows 2003 Active Directory
Domain. I want to query all of the accounts, domain and local.

If I log onto this machine as the domain administrator and using WMI
code creator use the query SELECT * FROM Win32_UserAccount then this
query returns all of the available users, local and domain.

However if I log onto another computer and then use WMI code creator
to remotely access the same machine as the domain administrator I only
receive back the local accounts on the target computer.

Is this expected behaviour and if so why don't I get the same list of
results. Is there a way to amend my query to ensure that all the
accounts are returned from the remote WMI connection.

AFAIK, this is the behavior I would expect. When you are logged on locally, naturally you are not going to be able to enumerate the accounts on a domain because you're not logged onto one.

To enumerate all accounts, run your query using a domain account.

--
Bill Stewart
.



Relevant Pages