getOSUserID()

Returns the operating system ID of a specific user.

Synopsis

string getOSUserID( string name[, string domain]);

Parameters

Parameter Description
name Name of the user.
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 operating system ID is not found. In case of an invalid domain name, an empty string is returned under Windows. Under Linux the invalid domain name is ignored and the valid operating system ID for the user is returned.

In this case, specify the correct domain by using the parameter "domain".

Example:

  • The user belongs to the domain "Domain1" and the computer used to execute the query was logged on in the same domain ->the operating system ID is found.

  • The computer is logged on in another domain than "Domain1", the operating system ID is not found or if a user with the same name exists in this other domain, the wrong operating system ID is found.

Return value

The operating system ID of a specific user.

Description

Returns the operating system ID of a specific user. Note that the parameter domain name is ignored under Linux.

Example

The following example returns the OS-ID for the user "MDavis" from the domain "ET101".

main()
{
                                
  DebugN(getOSUserID("MDavis", "ET101")); 
  //Return value:
  "S-1-5-21-1934636824-790261252-315576832-2029"
                                
}

Assignment

User administration

Availability

CTRL