Well, I am certainly full of hot air today – 3 posts!
Netdom.exe is a *very* powerful tool but you need Administrator access to the machine. The ‘latest’ version of Netdom.exe is available in the ‘Windows Server 2003 Service Pack 1 Support Tools’ download [1,2]
Our primary use for Netdom is to add machines to the Domain in a controlled manor. With the restructure there will be a requirement to take machines off the network, rename them, then join them back onto the network … Netdom should be able to help us out.
==== START NETDOM HELP ==== Windows Domain Manager (netdom.exe) [W2K3-SRV v.5.2.3790.0] —The netdom.exe Windows Support Tool lets you work with Windows domains and trusts. You can use netdom.exe to add and remove computer accounts from a domain, reset computer account passwords, move servers among domains, and establish one- and two-way trusts between Windows domains. Because netdom.exe is a command-line tool, it can add powerful capabilities to your administrative scripts. >netdom ? The syntax of this command is: NETDOM HELP command -or- NETDOM command /help Commands available are: NETDOM ADD NETDOM RESETPWD NETDOM RESET NETDOM COMPUTERNAME NETDOM QUERY NETDOM TRUST NETDOM HELP NETDOM REMOVE NETDOM VERIFY NETDOM JOIN NETDOM MOVENT4BDC NETDOM MOVE NETDOM RENAMECOMPUTERNETDOM HELP SYNTAX explains how to read NET HELP syntax lines. NETDOM HELP command | MORE displays Help one screen at a time. Note that verbose output can be specified by including /VERBOSE with any of the above netdom commands. >netdom join /help /verbose The syntax of this command is: NETDOM JOIN machine /Domain:domain [/OU:ou path] [/UserD:user] [/PasswordD:[password | *]] [UserO:user] [/PasswordO:[password | *]] [/REBoot[:Time in seconds]] NETDOM JOIN Joins a workstation or member server to the domain. machine is the name of the workstation or member server to be joined /Domain Specifies the domain which the machine should join. You can specify a particular domain controller by entering /Domain:domaindc. If you specify a domain controller, you must also include the user's domain. For example: /UserD:domainuser /UserD User account used to make the connection with the domain specified by the /Domain argument /PasswordD Password of the user account specified by /UserD. A * means to prompt for the password /UserO User account used to make the connection with the machine to be joined /PasswordO Password of the user account specified by /UserO. A * means to prompt for the password /OU Organizational unit under which to create the machine account. This must be a fully qualified RFC 1779 DN for the OU. If not specified, the account will be created under the default organization unit for machine objects for that domain. /REBoot Specifies that the machine should be shutdown and automatically rebooted after the Join has completed. The number of seconds before automatic shutdown can also be provided. Default is 30 seconds Windows Professional machines with the ForceGuest setting enabled (which is the default for machines not joined to a domain during setup) cannot be remotely administered. Thus the join operation must be run directly on the machine when the ForceGuest setting is enabled. When joining a machine running Windows NT version 4 or before to the domain the operation is not transacted. Thus, a failure during the operation could leave the machine in an undetermined state with respect to the domain it is joined to. The act of joining a machine to the domain will create an account for the machine on the domain if it does not already exist. ==== END NETDOM HELP ====
So, to join the DOMAIN (from the machine) …
:: ==== begin JoinDomain.cmd ====
:: ——————————————————————–
:: Batchfile : JoinDomain.cmd
:: Purpose : Join EDFAC Domain using netdom.exe
:: OS : Windows 2K, XP
:: Created : Darren Robertson (ed-IT)
:: Required : NETDOM.EXE (W2k3 SRV CD), login as local Administrator
:: ——————————————————————–
:: please place netdom.exe into the “%system%\SYSTEM32\” folder
:: for all SOE builds to allow for Administration
:: ——————————————————————–NETDOM JOIN %computername% /Domain:EDFAC /UserD:Administrator {linewrap}
/passwordD:_can_be_here_or_be _prompted /REBoot:10
:: ==== end JoinDomain.cmd ====
To rename a machine the NETDOM RENAMECOMPUTER machine /NewName:new-name command could be used, but this could have an adverse impact in some cases. It is much better to leave the Domain, rename the machine, then rejoin the Domain. This will use the NETDOM REMOVE machine /Domain:domain command.
==== START NETDOM HELP ====
>netdom remove /help /verbose
The syntax of this command is:
NETDOM REMOVE machine /Domain:domain [/UserD:user]
[/PasswordD:[password | *]]
[UserO:user] [/PasswordO:[password | *]]
[/REBoot[:Time in seconds]]
NETDOM REMOVE Removes a workstation or server from the domain.
machine is the name of the computer to be removed
/Domain Specifies the domain in which to remove the machine
/UserD User account used to make the connection with the domain
specified by the /Domain argument
/PasswordD Password of the user account specified by /UserD. A * means
to prompt for the password
/UserO User account used to make the connection with the machine to be
removed
/PasswordO Password of the user account specified By /UserO. A * means
to prompt for the password
/REBoot Specifies that the machine should be shutdown and automatically
rebooted after the Remove has completed. The number of seconds
before automatic shutdown can also be provided. Default is
30 seconds
NETDOM HELP command | MORE displays Help one screen at a time.
The command completed successfully.
==== END NETDOM HELP ====
So to leave the DOMAIN (from the machine) …
:: ==== begin LeaveDomain.cmd ====
:: ——————————————————————–
:: Batchfile : LeaveDomain.cmd
:: Purpose : Leave EDFAC Domain using netdom.exe
:: OS : Windows 2K, XP
:: Created : Darren Robertson (ed-IT)
:: Required : NETDOM.EXE (W2k3 SRV CD), login as local Administrator
:: ——————————————————————–
:: please place netdom.exe into the “%system%\SYSTEM32\” folder
:: for all SOE builds to allow for Administration
:: ——————————————————————–NETDOM REMOVE %computername% /Domain:EDFAC /UserD:Administrator {linewrap}
/passwordD:_can_be_here_or_be _prompted /REBoot:10:: ==== end LeaveDomain ====
To make coffee you use NETDOM COFFEE machine /Espresso:real-strong /Milk:light *CHUCKLE*
[1.] Windows Server 2003 Service Pack 1 Support Tools [MS]
[2.] Download Windows Server 2003 SP1 Support Tools (5.21mb) [MS]
[3.] Netdom Overview [MS]











