Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Joining a server or client device to a domain is an essential step for achieving centralized management and improved security within an organization's network. Whether you're configuring a new device or optimizing your network setup, follow this guide for a seamless integration into your domain environment.
Prerequisites
Server requirements
Your Windows Server device must have the Active Directory Domain Services role installed to use the Active Directory Users and Computers (ADUC) tool. To learn more, see Install or Uninstall Roles, Role Services, or Features.
You must be a member of the Administrators group or have administrative privileges on both the local account and domain account.
Client requirements
The user account must have administrative privileges on the local machine to join a domain.
Your client device must have one of the following versions of Windows installed:
- Enterprise
- Enterprise N
- Pro
- Pro N
- Pro Education
- Pro Education N
- Pro for Workstations
- Pro N for Workstations
Note
To keep time synchronized, organizations often use the Windows Time Service or a Network Time Protocol (NTP) server. Within a domain, computers typically sync their clocks with the Domain Controller, which should be aligned with a dependable time source. This process ensures consistent time settings across all devices in the domain, minimizing potential issues with Kerberos authentication.
Prestage a device using ADUC
This step is optional and not mandatory for joining a device to a domain. However, prestaging a device in Active Directory can streamline the process by pre-assigning the computer account to the appropriate organizational unit (OU) and ensuring proper permissions are in place before the device joins the domain.
In Server Manager, select the Tools button from the top right menu.
In the drop-down menu, select Active Directory Users and Computers.
In the left pane, navigate to and select the appropriate organizational unit (OU).
Select the Actions tab, select New, then select Computer.
Enter the computer name and configure which user or group the device should belong to.
Select OK This can help prepare for when the client is ready to join the domain.
Join a device to a domain
Joining a device to a domain can be done using either graphical user interface (GUI) methods or command-line tools, depending on your preference and the needs of your environment. Both approaches ensure integration into the domain.
Server Manager method
In Server Manager, select Local Server, under Workgroup, select the workgroup or domain name hyperlink.
Under the Computer Name tab, select Change.
Under Member of, select Domain, type the name of the domain that you wish the computer to join, and then select OK.
Provide the credentials needed to join the domain, then select OK.
After the device successfully joins the domain, a notification confirms the device's domain membership. Select OK, and you're prompted to restart your device.
Control Panel method
Select Start, type Control Panel, and then press ENTER.
Ensure that from the View by drop-down menu at the top right is set to Category.
Navigate to System and Security, then select System.
Select Domain or workgroup, under the Computer Name tab, select Change.
Under Member of, select Domain, type the name of the domain that you wish the computer to join, and then select OK.
Provide the credentials needed to join the domain, then select OK.
After the device successfully joins the domain, a notification confirms the device's domain membership. Select OK, and you're prompted to restart your device.
Select Start, type Control Panel, and then press ENTER.
Ensure that from the View by drop-down menu at the top right is set to Category.
Navigate to System and Security, then select System.
Select Advanced system settings, then select Change settings.
Under the Computer Name tab, select Change. '
Under Member of, select Domain, type the name of the domain that you wish the computer to join, and then select OK.
Provide the credentials needed to join the domain, then select OK.
After the device successfully joins the domain, a notification confirms the device's domain membership. Select OK, and you're prompted to restart your device.
Select Start, type Control Panel, and then press ENTER.
Ensure that from the View by drop-down menu at the top right is set to Category.
Navigate to System and Security, then select System.
Under Computer name, domain, and workgroup settings, select Change settings.
Under the Computer Name tab, select Change. '
Under Member of, select Domain, type the name of the domain that you wish the computer to join, and then select OK.
Provide the credentials needed to join the domain, then select OK.
After the device successfully joins the domain, a notification confirms the device's domain membership. Select OK, and you're prompted to restart your device.
Settings app method
Select Start, select Settings, then select Accounts.
Select Access work or school, then select Connect.
Select Join this device to a local Active Directory domain.
Enter the domain name, select Next, and the account credentials, then select OK.
Restart the device.
Command line method
Adding a device to a domain can be performed through the command prompt or PowerShell.
Open an elevated command prompt window.
Run the following command replacing
YourDomainName
andDomainUsername
with your values:netdom join %COMPUTERNAME% /domain:YourDomainName /userd:DomainUsername /passwordd:*
The system prompts you to enter the password for the specified domain user account.
Reboot your device. Once you sign in, you're joined to the domain.
Rejoin a disjoined device to a domain
In cases where a client or server device is disjoined from the domain, you can restore its trust relationship by removing the device from the domain and then rejoining it. This process re-establishes the connection between the device and the domain. The process in leaving a domain is similar to joining one.
Rejoin a domain using Server Manager
To leave a domain using the Server Manager, follow the previous steps to join the domain until you reach the System Properties window.
Under Member of, select Workgroup, type the name of a workgroup to temporarily join, and then select OK.
Select OK again and then reboot your device.
Once you sign back into the local account, repeat the steps to join your device to the domain it was disjoined from previously.
Rejoin a server to a domain using Control Panel
To leave a domain using the Control Panel, follow the previous steps to join the domain until you reach the System Properties window.
Under Member of, select Workgroup, type the name of a workgroup to temporarily join, and then select OK.
Select OK again and then reboot your device.
Once you sign back into the local account, repeat the steps to join your device to the domain it was disjoined from previously.
Rejoin a client to a domain using Control Panel
To leave a domain using the Control Panel, follow the previous steps to join the domain until you reach the System Properties window.
Under Member of, select Workgroup, type the name of a workgroup to temporarily join, and then select OK.
Select OK again and then reboot your device.
Once you sign back into the local account, repeat the steps to rejoin your device to the domain it was disjoined from previously.
Rejoin a domain using Settings
To leave a domain using the Settings app, follow the previous steps to join the domain until you reach the Access work or school window.
Under your account, select Disconnect, then select Yes.
Reboot your device.
Once you sign back into the local account, repeat the steps to rejoin your device to the domain it was disjoined from previously.
Rejoin a domain using the command line
To leave a domain using the command line, follow these steps:
Open an elevated command prompt window.
Run the following command replacing
YourDomainName
andDomainUsername
with your values:netdom remove %COMPUTERNAME% /domain:YourDomainName /userd:DomainUsername /passwordd:*
The system prompts you to enter the password for the specified domain user account.
After your device reboots, sign into the local account.
Follow the steps provided in Command line method to rejoin the domain.
Repair domain trust relationship
You might encounter the following error when the secure channel between a domain-joined computer and the domain controller is disrupted:
The trust relationship between this workstation and the primary domain failed.
This error typically occurs when the machine's password isn't synchronized with the domain database. It can also happen if the computer account in the domain was deleted or became corrupt. You can resolve the trust relationship issue between the device and the domain using the command line.
Sign in with the local administrator account.
Open an elevated command prompt window.
Test the secure channel by running the following command replacing
ComputerName
andYourDomainName
with your values:netdom verify ComputerName /domain:YourDomainName
Reset the machine password by running the following command replacing
DomainControllerName
andDomain\Username
with your values:netdom resetpwd /server:DomainControllerName /userd:Domain\Username /passwordd:*
You're prompted to provide the password for the account.
Run the following command replacing
YourDomainName
andDomainUsername
with your values to reset the secure channel:netdom reset /domain:YourDomainName /userd:DomainUsername /passwordd:*
You're prompted to provide the password for the account.
Restart your device for changes to take effect. Follow the steps provided in Command line method to rejoin the domain.