For general information about "The parameter is incorrect." error see the link to Error code 87
NET USER functions (such as, UserGetLocalGroups)The User*() functions operate on NT user accounts. Administrator or Account Operator group membership is required to successfully execute most of these functions on a remote server or on a computer that has local security enabled. Administrator privileges are required to add an Administrator Privilege account. There are some exceptions to this whereby a user can change some of their own settings where these don't conflict with "administrative information" (e.g. full name).
The server field can be the empty string, in which case the function defaults to running on the local computer. If you leave this field blank then you should ensure that you are running the function on a PDC or BDC for your current domain. Use the support function GetDCName() to find out what the domain controller is, should you not be running this on the PDC.
All functions in this section are "domain functions". This means that, for example, the UserGetLocalGroups() function actually lists the domain's local groups of which the named user is a member.
UserGetLocalGroups(server, user, array[, flags])
Gets the names of the local groups of which user is a member. Unlike the NetUserEnum() function in the API, this function does not allow you to specify a level. Since the underlying API restricts you to level 0 there really isn't any need to include it.
server - Scalar StringThe server from which to get the local groups of which user is a member. user - Scalar StringThe user whose local group membership you wish to enumerate. array - Array ReferenceThe array that will hold the names of the local groups to which user belongs. flags - Scalar Int <em>(optional)</em>Either Win32API::Net::LG_INCLUDE_INDIRECT() or 0. if flags is omitted, the function internally uses 0. Specifying LG_INCLUDE_INDIRECT() will include in the list the names of the groups of which the user is indirectly a member (e.g. by being in a global group that is a member of a local group). This field can take no other values.