getOSGroups()

Returns an array containing the attributes of all groups of a domain (no local groups).

Synopsis

dyn_mapping getOSGroups([ string domain ]);

Parameters

Parameter Description
domain

The parameter "domain" specifies in which domain the query is executed. The default value is the domain of the current computer (where the query is executed). If only one domain exists in the IT infrastructure, the parameter does not bear a meaning. If the IT infrastructure consists of several domains and a group was created in another domain than where the query is executed, the attributes of the group are not found. In this case, specify the correct domain by using the parameter "domain".

Example:

  • The group belongs to the domain "Domain1" and the computer used to execute the query was logged on in the same domain -> the attributes of the groups are found.

  • The computer is logged on in another domain than "Domain1" and groups with the same name exists in this other domain, the attributes of the wrong groups are found.

Return value

The function returns an array containing the attributes of all groups of a domain.

Description

Returns an array containing the attributes of all groups of a domain (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

The following example,returns an array containing the attributes of all groups of a domain

main()
{
  dyn_mapping m;
  m = getOSGroups();
  DebugN("OS groups", m);
}

Assignment

User administration

Availability

CTRL