Software Development Kit (SDK) and API Discussions

Getting error while using NetUserGetLocalGroups() API

CHIRANJIVCCHOUDHARY

Getting error while using NetUserGetLocalGroups() API. I am using the API to check if the domain user exists in any group.

LPLOCALGROUP_USERS_INFO_0 pBuf = NULL;

        DWORD dwLevel = 0;

        DWORD dwFlags = LG_INCLUDE_INDIRECT ;

        DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;

        DWORD dwEntriesRead = 0;

        DWORD dwTotalEntries = 0;

        NET_API_STATUS nStatus;

        BOOL bAdmin = FALSE;

          

        //

        // Call the NetUserGetLocalGroups function

        //  specifying information level 0.

        //

        //  The LG_INCLUDE_INDIRECT flag specifies that the

        //   function should also return the names of the local

        //   groups in which the user is indirectly a member.

        //

        nStatus = NetUserGetLocalGroups(wszMachineName,

                                        wszUser,

                                        dwLevel,

                                        dwFlags,

                                        (LPBYTE *) &pBuf,

                                        dwPrefMaxLen,

                                        &dwEntriesRead,

                                        &dwTotalEntries);

This call fails with System Error:1726

RPC_S_CALL_FAILED
1726 (0x6BE)

The remote procedure call failed.

Any workaround or suggestions ?

0 REPLIES 0
Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public