Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I lost my domain controller machine, and then add new domain controller but with a new domain. How do I remove network machines from old domain using command line and add to new domain? Machines using Windows Server 2008 Core (command line only)

net computer \\name del

works only on domain controller.


When I try to exit from old domain, console requests username and password for exit. I type it, and then get error "Could not connect to domain" (old domain controller not exists)

What to do?

share|improve this question
up vote 7 down vote accepted

Try netdom remove computername /Domain:domain /UserD:user /PasswordD:* /Force

Type netdom remove /? for the full command usage. The /Force option is what you're looking for. Per the help:

Forces the unjoin of the machine from the domain even if the domain is not found or does not contain the matching computer object.

To join the members to the new domain: netdom join computername /Domain:domain /UserD:user /PasswordD:*

Again type netdom join /? for help with the command usage.

share|improve this answer
For those of you lacking the netdom executable, this can be installed as part of the RSAT (W8.1) / RSAT (W7) package. Download, install, then go to Control Panel > Turn Windows features on or off. Under RSAT select AD DS Snap-ins and Command-line Tools as per screenshot. – Chris Pickford Feb 9 '15 at 18:33
What's the point of the /domain etc? netdom remove computername /force worked perfectly for me. – Pieter van Ginkel May 18 at 18:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.