getOSUsers()

Returns an array (mapping) containing the user data (name, full name, OSID, Comment, PrimaryGroupOSID, PrimaryGroupName).

Synopsis

dyn_mapping getOSUsers([ 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 user was created in another domain than where the query is executed, the user is not found. In this case, specify the correct domain by using the parameter "domain".

Example:

  • The users belong to the domain "Domain1" and the computer used to execute the query was logged on in the same domain -> the users are found.

  • The computer is logged on in another domain than "Domain1", the users of this other domain are found.

The parameter domain is not considered under Linux. If you specify the parameter, an error is returned.

Return value

The function returns an array containing the user data, see below..

Description

Returns an array (mapping) containing the user data. The attributes are stored in a mapping with the following keys:

  • "Comment": Description of the users. 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 users

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

  • "OSID": Operating system ID of the groups

    "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": Full names of the users

Example

The following example,returns a mapping containing the user data (name, full name, OSID, Comment PrimaryGroupOSID, PrimaryGroupName).

main()
{
  dyn_mapping m;
  m = getOSUsers();
  DebugN("User data", m);
}

Assignment

User administration

Availability

CTRL