getOSUserGroups()

Returns an array containing the attributes of all groups a user is member of.

Synopsis

dyn_mapping getOSUserGroups( string userName);

Parameters

Parameter Description
userName The name of the user whose group memberships should be returned.

Return value

An array containing the attributes of all groups a user is member of.

Description

Returns an array containing the attributes of all groups a user is member of (in a domain only (no local groups)). The attributes are saved in a mapping with the following keys:

"Name": Name of the group

"Comment": Description of the group

"OSID": Operating system ID of the group

"OSID" may return another value for Unix systems than for Windows systems in an ActiveDirectory environment since Unix (for example, Samba) maps the Windows specific ID (SID) into a Unix specific ID (unsigned).

Under Linux the "GECOS" entry form the password file is split into "Fullname,Comment". If no "," is available the "Comment" entry will be empty.

Example

Returns array containing the attributes of all groups a user is member of.

main()
{
  dyn_mapping m;
  string usName = "MDavis";
  m = getOSUserGroups(usName);
  DebugN("Group memberships of user MDavis ", m);
}

Assignment

User administration

Availability

CTRL