How to get a list of Windows administrators Account?

How to get the list?Thank a lots.

Yours gamma.

Why do you think that you want to do this? If you need to see if a user is a member if the Administrators group, then you should ACL against that group.

To answer your original question, of which I am however dubious of the nature of, however:

I would call LookupAccountSid to retrieve the name for the BUILTIN\Administrators group using the well-known SID for that group, and then pass the name to NetLocalGroupGetMembers.

You should not hardcode “BUILTIN\Administrators” for localization related purposes.

  • S

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Thursday, February 19, 2009 9:44 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to get a list of Windows administrators Account?

How to get the list?Thank a lots.

Yours gamma.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer