WMI "Select" query for a local user account that EXISTS?

I am seeking a WMI "select" query that I can use to determine whether or not a local user account on a workstation exists.

For instance, a query that would evaluate TRUE if the local account "JohnDoe" existed.  This query would be used for targeting GPOs and Group Policy Preferences.

Any help is appreciated.
amendalaAsked:
Who is Participating?
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Something like this:

Select * from Win32_UserAccount Where LocalAccount = True and Name = 'JohnDoe'
0
 
amendalaAuthor Commented:
That works!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.