getCurrentDomainName()

The function getCurrentDomainName() returns the current domain of the user.

Synopsis

int getCurrentDomainName( string &domain);

Parameters

Parameter Description
&domain The current domain.

Return value

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

Error

Missing or wrong parameters.

Description

The function returns the current domain of the user. This means the domain the user belongs to.

A computer can also be part of a domain. If a local user is logged in, the function getCurrentDomainName returns the computer name instead of the domain. To query the domain name of the computer, use the function getOSDomainName().

Example

The function returns the current domain of the user.

main()
{
  string domain;
  int i = getCurrentDomainName(domain);
  DebugN(i, domain);
}                           

Assignment

User administration, Waiting Control function

Availability

CTRL

See also

getAllOSGroups(), getCurrentOSUser(), getAllOSUsers(), getWindowsEvents(), getOSDomainName() and verifyOSUser()