Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6776115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:59:21+00:00 2026-05-26T15:59:21+00:00

I want to get users of a group using NetGroupGetUsers function. DWORD dwError =

  • 0

I want to get users of a group using NetGroupGetUsers function.

DWORD dwError = 0;
NET_API_STATUS nStatus;
LPDWORD entriesread=0;
LPDWORD totalentries=0;
LPBYTE *buff;
nStatus=NetGroupGetUsers(NULL,L"Users",0,buff,MAX_PREFERRED_LENGTH,
                          entriesread,totalentries,NULL);

When i use this i get this error;

xC0000005: Access violation reading location 0xffffffffffffffff.

And how can i read buff when it works? And also i tried this;

GROUP_USERS_INFO_0 *buff;
nStatus=NetGroupGetUsers(NULL,L"Users",0,(LPBYTE*)&buff,MAX_PREFERRED_LENGTH,
entriesread,totalentries,NULL);

but same error occurred.

EDIT: nStatus value is NERR_GroupNotFound i think the reason of the access violation is trying to read buff which isn’t actually set.

EDIT 2: i used this function NetLocalGroupGetMembers. now it gives success but the buff->grui0_name is meaningless. there is a user named “ali” but the value of the buff->grui0_name is just “d”. WHAT AM I DOING WRONG?

The Last Code;

LPCWSTR TargetGroup = L"group1";

DWORD dwError = 0;
NET_API_STATUS stat;

GROUP_USERS_INFO_0 *buff;
LPDWORD entriesread=new DWORD;
LPDWORD totalentries=new DWORD;

stat=NetGroupGetUsers(NULL,TargetGroup,0,(LPBYTE *)&buff,MAX_PREFERRED_LENGTH,
                          entriesread,totalentries,NULL);

for EDIT 2;

stat=NetLocalGroupGetMembers(NULL,TargetGroup,0,(LPBYTE *)&buff,
                  MAX_PREFERRED_LENGTH,entriesread,totalentries,NULL);

Please help…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:59:21+00:00Added an answer on May 26, 2026 at 3:59 pm
    LPCWSTR TargetGroup = L"group1";
    
    NET_API_STATUS stat;
    
    LOCALGROUP_MEMBERS_INFO_1 *buff;
    LPDWORD entriesread=new DWORD;
    LPDWORD totalentries=new DWORD;
    
    stat=NetLocalGroupGetMembers(NULL,TargetGroup,1,(LPBYTE *)&buff,
                            MAX_PREFERRED_LENGTH,entriesread,totalentries,NULL);
    
    
    
    wprintf(buff->lgrmi1_name);
    

    This code is working great now. Thanks to everybody.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to get money from users phone using Java application? So I want to
I am using a group by clause in my query. I want to get
The scenario is I want to get the users who has less than 2
In my forum that I am building, I want to get information about users
i want to get the full address of user programatically using c# how can
I have a security descriptor for an object. I want to get users and
I am using http://mpcabd.igeex.biz/get-online-users-in-django/ to successfully get the list of online users. I am
We're using LDAP to authenticate users against a large Active Directory setup. We want
I want to get user input in one page, store that in a php
i want to get the user who login now .. how to do this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.