getOSUser()

The function getOSUser returns the user name, the full name, the OS ID, the domain and the comment of the current user.

Synopsis

mapping getOsUser();

Synopsis

-

Return Value

A mapping containing the user data.

Error

The function returns -1 in case of errors and otherwise 0.

Description

The function getOSUser returns the user name, the full name, the OS ID, the domain and the comment of the current user. The function returns the owner of the process, meaning the current user of the process in which the control is running.

Under Linux the function does not return the domain.

Example

main()
{
  mapping m;
  DebugN(m = getOSUser());
  / / Returns the data of the current user
}                             

The function outputs:

WCCOAui1:["User:,"][mapping 5 items
WCCOAui1: "Comment" : ["Comment"]
WCCOAui1: "Name" : ["Name of the user]"
WCCOAui1: "OSID" : ["OS ID"]
WCCOAui1: "FullName" : ["Full name of the user"]
WCCOAui1: "Domain" : ["Windows domain"]
WCCOAui1:]

Assignment

User administration, waiting control function.

Availability

UI, CTRL

See also

getAllOSGroups(), getAllOSUsers(), getCurrentDomainName(), getWindowsEvents() and verifyOSUser()