domain

display 8.1/2012R2/10/2016/2019/11/2022 domain information 

Command


SYNOPSIS

domain [-S hostname | -D domain-name] [-abcemst] [domain ...]

domain [-S hostname | -D domain-name] -w [workstation ...]

domain -l


DESCRIPTION

The domain command displays workstation domain information on the standard output.

Options

-a 

displays the host names of any single domain controller (primary or backup) for each specified domain. When you do not specify any domain arguments, this option displays the name of the domain controller for the local machine.

-b 

displays the host names of all the backup domain controllers for each specified domain. When no domain arguments are specified, this option displays the host names of the backup domain controllers for the local machine.

-c 

displays the machine names of all members of each specified domain. When you do not specify any domain arguments, this option displays the list of machine names of the domain that contains the local machine.

-e 

displays all domains.

-l 

displays the domain of the user currently logged on to the system.

-m 

displays master network browsers (that is, servers running the network resource browser service).

-s 

displays the host name of the primary domain controller for each specified domain. When you do not specify any domain arguments, this option displays the host name of the primary domain controller for the domain that contains the local machine.

-t 

displays the list of trusted domains.

-w 

displays the current domain name for each specified workstation. This option is the default if no options are specified. When you do not specify any workstation arguments, this option displays the name of the domain for the current workstation.

All options but -l allow you to specify the following options to change the machine from which information is requested; these options are mutually exclusive:

-Ddomain-name 

locates the primary domain controller of the specified domain, and requests the information from that machine. domain normally performs actions on the local system.

The -D and -S options are mutually exclusive.

-S hostname 

requests the information from the specified machine called hostname. domain normally performs actions on the local system. Optionally, hostname may be preceded by \\ or //.

The -D and -S options are mutually exclusive.


EXAMPLES

The following script displays the brief information (userinfo -b) for the workstation trust account on each workstation that is a member of the same domain as the current machine.

for machine in $(domain -c)
do
    if ! userinfo -b -S $(domain -s) ${machine#??}\$ >nul
    then
        print -r "ERROR: Missing account for machine $machine on the" \
            "domain controller $(domain -s) in the domain $(domain)"
    fi
done

Note that the workstation trust account name strips the leading backslashes from the workstation name, and adds a trailing dollar sign; this is the policy that 8.1/2012R2/10/2016/2019/11/2022 uses.


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

>0 

An error occurred.


PORTABILITY

Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


AVAILABILITY

PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
userinfo


PTC MKS Toolkit 10.4 Documentation Build 39.