getCurrentOSUser() - obsolete

The function getCurrentOSUser() returns the user name, full name, description and the groups of a Windows user. Obsolete function, the functions 1.getOSUser() and 2.getOSUserGroups() replace the obsolete function.

Synopsis

int getCurrentOSUser(string &username, string &fullname, string

&description, dyn_string &groups [, string password]);

Synopsis

Parameter Meaning
&username The user name of the Windows user.
&fullname The full name of the Windows user.
&description The description of the Windows user.
&groups The user groups the Windows user belongs to.
password The password of the user. This parameter is optional. The password is, however, necessary to get the groups of the user.

Return Value

int

Error

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

Description

The function returns the user name, full name, description and the groups of a Windows user. The behavior of this function is controlled via the optional parameter password. If password exists, data of the user username are returned (in case of a correct username/password). If password is not specified, data of the current logged in user are returned (in this case no groups, the user belongs to, are returned).

Example

main()
{
  string user, full, desc, pass;
  dyn_string group;
  user="";
  getCurrentOSUser(user, full, desc, group);
  DebugN(user, full, desc, group);
} 
// Returns the data of the current user 

Example

main()
{
  string user, full, desc, pass;
  dyn_string group;
  user="mdavis";
  pass="password";
  getCurrentOSUser(user, full, desc, group,pass);
  DebugN(user, full, desc, group);
} 
// Returns the data of the user "mdavis" with
password "password"                            

Assignment

User administration, waiting control function.

Availability

CTRL

See also

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