getOSGroupUsers()

Returns all users of a group.

Synopsis

dyn_mapping getOSGroupUsers( string groupName, [ string domain]);

Parameters

Parameter Description
groupName The group name.

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 group is 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 group is found.

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

Return value

Users of a group.

Description

Returns all users of a group. Only users of a domain are returned (no local users).

The attributes are saved in a mapping with the following keys:

"PrimaryGroupOSID": The OS ID of the primary user group.

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

"Name" : Name of the user (Account name).

"Disabled": If the parameter "Disabled" is TRUE, the account is disabled and login is not possible.

"PrimaryGroupName": Name of the primary user group.

"OSID": Operating system ID.

"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).

"FullName": Whole name of the user (Display name).

Example

Returns all users of the group "Administrators".

main()
{
  dyn_mapping grUsers;
  string groupName = "Administrators";
  grUsers = getOSGroupUsers(groupName);
  DebugN("Users of the group Administrators", grUsers);
}

Assignment

User administration

Availability

CTRL