getDomainOSUser()

The function getDomainOSUser() returns the domain, the user name, the full name, the description and the groups of the Windows user logged in.

Synopsis

int getDomainOSUser(string &username, string &fullname, string &description, dyn_string &groups, string &domain, string password = "");

Synopsis

Parameter Meaning
&username The user name of the Windows user logged in.
&fullname The full name of the Windows user logged in.
&description The description of the Windows user logged in.
&groups The user groups the current Windows user belongs to.
&domain The domain of the Windows user logged in.
password An optional parameter that specifies the password of the user. Am empty password is passed by default.

Return Value

The function returns 0 if it was successfully executed.

Description

The function getDomainOSUser() returns the domain, the user name, the full name, the description and the groups of the Windows user logged in. In a multidomain environment where several domains exist, for example, a main domain and a sub domain, the domain of the user logged in and the domain of the computer the user is logged on can be different.

The function getDomainOSUser() not only returns the user data of the Windows user logged in but also the domain of the user in a string parameter "domain".

Example

The function getDomainOSUser() returns the domain, the user name, the full name, the description and the groups of the Windows user logged in.

main()
{ 
  string username;
  string fullname;
  string description;
  dyn_string groups;
  string domain;
  string password;
  int i = getDomainOSUser(username, fullname, description, groups,domain, password);
  DebugN(username, fullname, description, groups, domain,password);
}

Assignment

User administration

Availability

CTRL

See also

User administration