DOMAIN
— Join or leave a
network domain, or display the current domain membership status.
Syntax:
DOMAIN
domain /DS /L /OU:"
path" /P:
password /PDC /R /S:
server /U:
user /W /X /Y
/DS | delete the startup shortcut if successful |
/L | leave; remove the computer from the domain |
/OU:" path" | Full RFC 1779 path of the organizational unit to join |
/P: password | password for the administrative account |
/PDC | use the primary domain controller |
/R | reboot if the operation is successful |
/S: server | name of the server (domain controller) to use |
/U: user | administrative account to perform the operation |
/W | join a workgroup, not a domain |
/X | join even if computer is already part of a domain |
/Y | do not prompt before joining or leaving |
domain | name of the domain to join or leave |
If neither /L
nor a domain is
specified, the computer’s current domain membership status will be
displayed.
Use /L
to leave (“unjoin”) a domain. If you
specify both /L
and a domain, then
the domain must match the computer’s
current domain name. You can bypass this safety check by omitting the
domain.
If you specify /P:*
or if you give a user
name without a password, you will be prompted to
enter the password interactively.
By default, you will be prompted before joining or leaving a domain.
/Y
suppresses the prompt. If you specify /R
, the
computer will automatically reboot after a successful join or leave.
/R
and /Y
together will reboot with no chance to
cancel!
/OU
allows you to specify the organizational unit within the
domain you are joining. Give the full path, in RFC 1779 format, from the
innermost to the outermost unit; for example,
/OU:"ou=sales,ou=staff,dc=now99,dc=com"
. Alternatively, you can
pass the path as \
top-org\
sub-org…
(with a leading backslash) and the plugin will attempt to mangle it into
RFC 1779 format for you automatically. Do not use this option unless you
truly need to join a specific OU.
If /DS
is specified and a domain join or leave succeeds,
DOMAIN
will delete the shortcut used to launch TCC or the current
batch file. This option is not likely to be useful at the prompt! It’s
intended for use in turnkey batch files to join a computer to a domain, on the
theory that such a batch file will usually be called only once (after a
workstation is freshly imaged).
This command calls the NetJoinDomain() API.
domain mydomain /u:mydomain\machodude /p:Seekr3t /r /y
Return codes:
0 | success |
0 | syntax request via /? |
1 | syntax or usage error |
2 | the requested operation failed |
— | if the operation succeeded and /R was specified, DOMAIN will not return |