getOSUserName()

Returns the user name for an OS specific ID.

Synopsis

string getOSUserName(string osid, bool useCD, [string domain]);

Parameters

Parameters Description
osid The OS ID
useCD useDC specifies where the request is made (Default is the local computer). true means that the request is made on a Domain Controller
domain

The domain parameter specifies in which domain the query is executed.

The default value is the domain of the current computer (on which the query is executed).

If there is only one domain in the IT infrastructure, the parameter has no meaning.

If the IT infrastructure consists of several domains and a group was created in a different domain than the one where the query is executed, the attributes of the group will not be found. In this case, specify the correct domain by using the "domain" parameter.

Return value

The function returns the user name for an OS specific ID.

Description

Returns the user name for an OS specific ID.

Example

The following example returns the user name for the ID "S-1-5-21-1934636824-790261252-315576832-2029"

main()
{
  string osUName;
  string osID = "S-1-5-21-1934636824-790261252-315576832-2029";
  osUName= getOSUserName(osID, false);
  DebugN("User name", osUName);
}            

Assignment

User administration

Availability

CTRL