win32net.NetUserGetGroups

[(groupName, attribute), ...] = NetUserGetGroups(serverName, userName )

Returns a list of groups,attributes for all groups for the user.

Parameters

serverName : string

The name of the remote server on which the function is to execute. None or an empty string specifies the server program running on the local computer.

userName : string

The name of the user to search for in each group account.

To Do

This needs to be extended to support the new model, while not breaking existing code. A default arg would be perfect.

Return Value

Always makes the level 1 call and returns all data. Data return format is a Python List. Each "Item" is a tuple of (groupname, attributes). "(s,i)" respectively. In NT 4 the attributes seem to be hardcoded to 7. Earlier version of NT have not been tested.