NetGroupAdd ERROR_ACCESS_DENIED problem

  • Thread starter Thread starter su haiqing
  • Start date Start date
S

su haiqing

Hi All,

I am trying to use NetGroupAdd() to create a group on my computer, but it
always return ERROR_ACCESS_DENIED. Do you guys know how to resolve the
problem? (Windows Xp sp3)

///code here
_GROUP_INFO_0 groupInfo;
DWORD param_err;
NET_API_STATUS sResult;

ZeroMemory(&groupInfo, sizeof(groupInfo));

groupInfo.grpi0_name = L"testGroup";

USES_CONVERSION;
sResult = NetGroupAdd(NULL, 0, (LPBYTE)&groupInfo, &param_err);

/// end code

Thanks
Su
 
su haiqing said:
Hi All,

I am trying to use NetGroupAdd() to create a group on my computer, but it
always return ERROR_ACCESS_DENIED. Do you guys know how to resolve the
problem? (Windows Xp sp3)

Perhaps you need NetLocalGroupAdd, because you're running on a workstation,
not a domain controller?
 
su haiqing said:
Hi All,

I am trying to use NetGroupAdd() to create a group on my computer, but it always return
ERROR_ACCESS_DENIED. Do you guys know how to resolve the problem? (Windows Xp sp3)

///code here
_GROUP_INFO_0 groupInfo;
DWORD param_err;
NET_API_STATUS sResult;

ZeroMemory(&groupInfo, sizeof(groupInfo));

groupInfo.grpi0_name = L"testGroup";

USES_CONVERSION;
sResult = NetGroupAdd(NULL, 0, (LPBYTE)&groupInfo, &param_err);

/// end code

Thanks
Su


Do you run with administrative privileges?

Willy.
 
Back
Top