Command To Add Or Remove Computer From Domain

Sometimes, you need to remove your Windows computer from the domain manually; it can bother your workstation. There are also command to add or remove computer from domain easily.

To add or remove a computer from a domain you will need to run the command prompt as an administrator first. You can use the command net computer \\computername /add to add a computer to the domain and use the command net computer \\computername /del to delete or remove a computer from a domain. Don’t forget to press enter after writing the command.

So in this article, you will find some easy methods that you can use to remove your computer from the domain and disable the domain accounts of the computer.


How To Remove Computer From Domain

A single cmdlet, Remove-Computer, may be used to simultaneously remove both the local computer and the remote computer from their respective current domains. Use the Remove-Machine command to remove a computer from a domain. The domain account associated with the destroyed computer is also deactivated when you use this command.

To unlink a laptop from a part, you must supply explicit credentials in addition to those used to log in as the current user. Even if the credentials used to join the machine and log in as that user are the same. The modification will not take effect unless and until the computer restarts once it’s done. Move a computer to a workgroup to continue working when removed from a domain.

Use the Add-Computer cmdlet to transfer computers from one workgroup to another, from one domain to another, or from one workgroup to another, to mention a few instances. If you want the desired outcomes, you must utilize the Verbose and PassThru arguments with the command in question.

The Force option can suppress the user prompt and prevent it from appearing in it is wanted. Removing both the local computer and remote machines from a network may be accomplished with the Remove-Computer command.

There are also credentials parameters, which specify alternate credentials for connecting to remote computers and unjoining from a domain, a Restart parameter, which restarts the affected computers; and a WorkgroupName parameter, which specifies what name should be assigned to the workgroup to which the computers are added. There are also restart and workgroup name parameters.

Here’s how you can remove a computer from a domain:

Remove Using System Properties

Follow the procedures outlined in this article to unlink a Windows 10 computer from a network domain. System Properties must be used to do this.


  • Access the run from the Start menu by pressing the Windows key + R on the keyboard simultaneously. Start the software by typing i. Cpl in the Run box and press Enter to run it.
  • Clicking on the Computer Name tab and then clicking on the Change button (found at the bottom of the page) will allow you to change your computer’s name whenever the System Properties window appears.
  • After selecting the workgroup, right-click, in the text box that appears after clicking the radio button, type the workgroup’s name after unaffiliating from the domain, followed by the hyphen (-). To proceed, click on the OK button.
  • Allow should be selected if you are prompted. If you want the changes to take effect, you’ll need to restart your computer once you’ve finished making the adjustments.

Remove Using Settings App

Following the steps explained in this article, you may remove a Windows 10 computer from a domain by using the Settings App on your device, which is accessible through the Start menu.

  • Launch Settings app, select Accounts -> Access work or school from the drop-down menu in the Accounts section. To disconnect from your domain’s Active Directory, pick Disconnect from the drop-down option that appears when you select the Connected to (your domain) AD domain icon in the right pane.
  • If you need to confirm your selection, select Yes from the drop-down menu.
  • When the question Disconnect from the organization comes on the screen, choose Disconnect from the drop-down menu that appears on the right side of the screen.
  • Unless you update this setting, your Windows 10 machine will no longer be a member of the active directory domain once restarted.

Remove Using Powershell

PowerShell is used in this demonstration to remove a Windows 10 computer from a domain, as described in the preceding section.

  • To unjoin the domain, open a command prompt with administrator privileges in Windows PowerShell and put the following command into it to complete the process.
  • Using the command Delete-Computer -UnjoinDomaincredential Domain NameAdministrator -PassThru -Verbose -Restart-Force on your computer, you may remove a piece of software.
  • To access the domain administrator account, you will be required to enter your password on a separate screen. To proceed, click OK.
  • When you log out of the domain, you will see a warning that you will need to remember the password for the local administrator account to get back into this machine. Continue by pressing the letter Y on your keyboard.
  • It will be essential to restart your computer for this unjoin procedure to be completed successfully.

Remove Local Computer From Domain

Using the UnjoinDomainCredential option, it is possible to supply the credentials of a domain administrator who has been unjoined from the domain.

The name of a user account with the power to remove computers from their current domain configuration can be given in this field. The current domain configuration will remove the domain.


Although the value of this parameter corresponds to the current user’s credentials, it is essential to provide specific credentials, such as those given by this parameter, to remove remote computers from a domain when they are located in another domain.

Individual users have their usernames and PSCredential objects by their domain names; for example, a PSCredential object, such as the one generated by the Get-Credential function, can be identified as Domain01User01.

A password must be entered if the cmdlet is used with a user name that has not been previously documented. Aside from that, it serves no use. The LocalCredential option requires that a user account to connect to remote machines be specified when utilizing the LocalCredential.

When the PassThru option is used, Removing-Computer creates a ComputerChangeInfo object, which may help track down errors during debugging. When used in any of the other scenarios, this cmdlet does not provide any results. Utilizing the PassThru and Verbose standard parameters makes it possible to receive information about whether a command was successful or unsuccessful.

It is necessary to restart the computer to continue the removal process once it has been halted by selecting the Restart option. If there is no workgroup name provided, it is possible to transfer a computer to another workgroup;  the computer is assigned to the workgroup that has been chosen after being removed from its domain.

How to Move Several Computers To A Legacy Workshop

Specifies the credentials of a user who has been granted permission by the system administrator to access a distant computer through the use of a network connection, as specified in the LocalCredential option.

To utilize the UnjoinDomainCredential option, you must first give the credentials of a person in charge of removing computers from their respective domains. Using the Force option, you may prevent the confirmation prompts from appearing on every machine in the network. Each of the computers in the domain is restarted when the Restart option is selected, even if the devices have been removed from the domain before.

Remove Computers From Workgroup Without Confirmation

The computers that will be removed from their respective domains are listed and identified in the next section. Unless otherwise provided, the default computer is the one to which the user is currently connected at the time of the request.

Enter the NetBIOS names, IP addresses, or fully qualified domain names (FQDN) of the remote machines in the text box below to connect to them and establish a connection with their respective computers. You can input the machine name in the address bar, followed by a dot (.), or localhost to indicate that you are on a local computer.

It is crucial to note that this option does not rely on PowerShell remoting to function correctly. Even if your system is not configured to accept remote instructions from other computers, removing a computer from the network bypassing the ComputerName parameter of the Remove-Computer command to the command is still possible. When computers are removed from their domains to join the workgroup to which they will be assigned, it is necessary to fill up this part of the configuration file for them to function correctly. By default, it is presumed that the value of this variable is the WORKGROUP keyword.

Before removing the computer from the domain that it is presently a member of, you must first connect it to a workgroup on the network. Force disables the appearance of confirmation questions on any machines connected to the web due to this configuration. The Restart option must be used for the update to take effect on both machines. If the Restart option is used, both computers must be rebooted for the update to take effect.

Hopefully, you have found a suitable solution to remove your computer from the domain in this article.


How can I add a machine to a domain manually?

Go to system, then Security. Change the computer name, domain, and workgroup. On the Computer Name tab, click the Change button. Click Domain under Member of, type in the domain name, then connects OK.

What’s the difference between a domain and a workgroup?

The fundamental difference between workgroups and domains is resource management. Home computers are allocated to a workgroup, and office machines are assigned to a domain.