Netusergetinfo API works only if the user has Admin or group access. Is there any other Microsoft API which works without this privileges?

Cmp Sowmya 5 Reputation points
2023-01-20T13:54:03.3033333+00:00

In general, the user must have admin access or group access for using Windows Active Directory. From customer log, we confirmed that they do not have such access.

 Since the user do not have the privileges, it fails in the NetUSerGetInfo API call and returned the nStatus as 5.

 NetUserGetinfo failed with nStatus: 5

 Return codeDescriptionERROR_ACCESS_DENIEDThe user does not have access to the requested information.

 Below is the document we referred from Microsoft for Error_Access_Denied.

 https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/netuser-netgroup-fails-with-access-denied

Our code was implemented according to Requirements for Network Management Functions on Active Directory Domain Controllers.

 

If we call the Windows API which is listed in the below document either it should allow the access or denied based on the Access control list.

 Below is the document / link from Microsoft for this:https://learn.microsoft.com/en-us/windows/win32/netmgmt/requirements-for-network-management-functions-on-active-directory-domain-controllers

The default security policy restricts anonymous local access to having no rights. A local access group exists for applications with the same access rights as Everyone. Administrators can then appropriately increase or decrease the number of users in that group, named the Pre-Windows 2000-Compatible Access Group.

 

Due to security policy in customer end they can't give this privileges to all. So that NetUserGetInfo API fail to admit the User.

 

Our Query is :-
Is there any other Microsoft API call to fix this issue that allow normal user to access the Windows active directory without any privileges?

 

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,387 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,482 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 13,971 Reputation points Microsoft Vendor
    2023-01-30T07:54:45.1433333+00:00

    Hi @Cmp Sowmya ,

    After discussing with the engineer today, confirm that there is currently no API or method that can meet your needs.

    Thank you.

    0 comments No comments