title: NetUserGetLocalGroups (NULL, ... ) returns 1722 RPC_S_SERVER_UNAVAILABLE
body: <p>NetUserGetLocalGroups API retrieves a list of local groups to which a specified user belongs:</p>
  <pre><code>NET_API_STATUS NET_API_FUNCTION NetUserGetLocalGroups(
    LPCWSTR servername,
    LPCWSTR username,
    DWORD   level,
    DWORD   flags,
    LPBYTE  *bufptr,
    DWORD   prefmaxlen,
    LPDWORD entriesread,
    LPDWORD totalentries
  );
  </code></pre>
  <p>Ref: <a href="https://docs.microsoft.com/en-us/windows/win32/api/lmaccess/nf-lmaccess-netusergetlocalgroups" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/windows/win32/api/lmaccess/nf-lmaccess-netusergetlocalgroups</a></p>
  <p>If <em>servername</em> parameter is NULL, the function executes for the local computer. This works fine in our test environment, and it fails with error 1722 (RPC_S_SERVER_UNAVAILABLE) for one of our customers.</p>
  <p>Microsoft documents this as: &quot;This error is returned if the <em>servername</em> parameter could not be found.&quot;</p>
  <p>At first sight, this doesn't make sense because NULL is an acceptable value.</p>
  <p>What should I check on the customer's machine to figure out why this fails? How to mitigate this issue?</p>