dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How can I retrieve users with Administrators privilege?

  1. #1
    Join Date
    Apr 2008
    Posts
    90

    How can I retrieve users with Administrators privilege?

    How can I programatically retrieve the list of users available in the 'Administrators' group
    which is accessible (in XP) through :

    Right click 'My Computer' -> Manage -> Computer Management (Local) -> System Tools ->
    Local Users and Groups -> Groups -> Administrators (double click).

    Using NetUserEnum(), I am able to retrieve users who are also Administrators but entries like
    XYZDomain\XYZAdminUser under the 'Administrators' group couldn't be retrieved.

    How could I specifically retrieve entries like 'XYZDomain\XYZAdminUser'.

    Thanks in Advance.

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,602

    Re: How can I retrieve users with Administrators privilege?

    NetLocalGroupGetMembers for local Administrators group
    NetGroupGetUsers for domain Administrators group

    BTW, what is the ultimate task for this enumeration?
    Last edited by Igor Vartanov; May 27th, 2008 at 04:22 AM.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)