How do I rejoin a domain in CMD?

Answered by Willian Lymon

To rejoin a domain using CMD (Command Prompt), you have a few options. I will provide step-by-step instructions for each method:

Method 1: Using the “Reset Account” feature in Active Directory (AD)

1. Open Active Directory Users and Computers on a domain controller.
2. Locate the computer object that you want to rejoin to the domain.
3. Right-click on the computer object and select “Reset Account.”
4. A dialog box will appear, asking if you want to reset the computer account. Click “Yes” to confirm.
5. Once the account is reset, you can try rebooting the computer and it should automatically attempt to rejoin the domain.

Method 2: Using the “dsmod” command in CMD

1. Open CMD as an administrator.
2. Type the following command, replacing “ComputerDN” with the distinguished name of the computer object you want to rejoin:
Dsmod computer “ComputerDN” -reset
3. Press Enter to execute the command.
4. After executing the command, you can try rebooting the computer and it should attempt to rejoin the domain.

Method 3: Using the “netdom” command in CMD

1. Open CMD as an administrator.
2. Type the following command, replacing “MachineName” with the name of the computer you want to rejoin, “DomainName” with the name of your domain, and “UserName” and “Password” with credentials of a domain administrator account:
Netdom reset MachineName /domain:DomainName /usero:UserName /passwordo:Password
3. Press Enter to execute the command.
4. After executing the command, you can try rebooting the computer and it should attempt to rejoin the domain.

It’s important to note that for Method 2 and Method 3, you may need to have the necessary administrative privileges to reset the computer account and rejoin the domain.

In my personal experience, I have used the “Reset Account” feature in Active Directory successfully to rejoin computers to the domain. However, the specific method you choose may depend on your access level and the specific requirements of your environment.

Remember to always exercise caution when performing administrative tasks, as incorrectly rejoining a computer to the domain can cause issues with network connectivity and access to resources.