locked
get local groups recursively RRS feed

  • Question

  • Hi,

    i have a local user 'TryUser' which is member of a localgroup 'TryGrp'

    ========== cmd out start ==========

    D:\>net localgroup TryGrp
    Alias name     TryGrp
    Comment        try group

    Members

    -------------------------------------------------------------------------------
    TryUser
    The command completed successfully.

    ========== cmd out end ==========

    'TryGrp' is a member of local group 'Administrators'

    ========== cmd out start ==========

    D:\Projects\WorkSpace\AT\at_test\eat2_test\VxEAT\v5.1.105.0\bin>net localgroup Administrator
    System error 1376 has occurred.

    The specified local group does not exist.


    D:\Projects\WorkSpace\AT\at_test\eat2_test\VxEAT\v5.1.105.0\bin>net localgroup Administrators
    Alias name     Administrators
    Comment        Administrators have complete and unrestricted access to the computer/domain

    Members

    -------------------------------------------------------------------------------
    Admin
    Administrator
    ENTERPRISE\Domain Admins
    ENTERPRISE\v023201
    TryGrp
    v023201
    The command completed successfully.

    ========== cmd out end ==========

    now i am trying to fetch local groups for user 'TryUser' using NetUserGetLocalGroups () API but only 'TryGrp' is listed.

    ========== cmd out start ==========

    D:\prac\local_groups\Debug>local_groups.exe

    Local group(s):
            -- TryGrp
            -- Users

    Entries enumerated: 2

    ========== cmd out end ==========

     i want to list 'Administrators' group too. how is this done? is there any way to get groups recursively? i checked MSDN but no help :-(.

    any help is greatly appritiated.



    Thanks,
    Mehul


    • Moved by nobugz Saturday, June 14, 2008 4:03 PM Not a C++ question. Post to forums.technet.com
    Saturday, June 14, 2008 3:49 PM

Answers