Announcement

Collapse
No announcement yet.

Remove pc from domain without being connected to DC

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remove pc from domain without being connected to DC

    Hi,

    I'm looking for a command to remove a pc from a domain, without the pc being connected to the DC, like for instance when the DC is down. Is this possible?

    Jvuz

  • #2
    Re: Remove pc from domain without being connected to DC

    you can just remove it.

    right click computer and go properties, disjoin the domain
    you don't even need the correct password (assuming you have local admin access)
    Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

    Comment


    • #3
      Re: Remove pc from domain without being connected to DC

      I know I can do that, but I'm looking for a way to this by a command (prompt). So I can put it into a batch.

      Comment


      • #4
        Re: Remove pc from domain without being connected to DC

        Looks as if netdom can do the job:
        https://groups.google.com/forum/#!to...pt/ZW1X1BzkfDE
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment


        • #5
          Re: Remove pc from domain without being connected to DC

          netdom does the job when connected, but I can't find the right way to do this without being connected

          Comment


          • #6
            Re: Remove pc from domain without being connected to DC

            Originally posted by jvuz View Post
            netdom does the job when connected, but I can't find the right way to do this without being connected
            This will work. Open an elevated command prompt (runas..) and run the following commands.

            The first command line will unjoin the computer, without trying to connect to the computer object in AD.
            After the first command the name of the workgroup will be the same as the netbios name of the "old" domain. The second command will rename the workgoup (if desired).
            The third command changes the name of the computer (if desired).
            The last command will reboot the computer to apply the changes.

            Code:
            @echo off
             start /B /W wmic.exe /interactive:off ComputerSystem Where "Name='%computername%'" Call UnJoinDomainOrWorkgroup FUnjoinOptions=0
             start /B /W wmic.exe /interactive:off ComputerSystem Where "Name='%computername%'" Call JoinDomainOrWorkgroup name="WORKGROUP"
             start /B /W wmic.exe /interactive:off ComputerSystem Where "Name='%computername%'" Call Rename name="standaloneComputer"
             shutdown.exe /r /t 0 /f
            /Rems


            Related Threads
            http://forums.petri.com/showthread.p...542#post272542

            This posting is provided "AS IS" with no warranties, and confers no rights.

            __________________

            ** Remember to give credit where credit's due **
            and leave Reputation Points for meaningful posts

            Comment


            • #7
              Re: Remove pc from domain without being connected to DC

              Amazing, you're the best!

              Comment


              • #8
                Re: Remove pc from domain without being connected to DC

                I still have a question. So now, I created the script where the computer gets 'unjoined' from the old domain and joined tot the new domain. And it works well. But the question now is, how to deploy this, because in my opinion it's not possible through GPO because the old one won't be there anymore and as long as you're not connected to the new domain, you cannot get their defined GPO's. What are my options?

                Jvuz

                Comment


                • #9
                  Re: Remove pc from domain without being connected to DC

                  Originally posted by jvuz View Post
                  I still have a question. So now, I created the script where the computer gets 'unjoined' from the old domain and joined tot the new domain. And it works well. But the question now is, how to deploy this, because in my opinion it's not possible through GPO because the old one won't be there anymore and as long as you're not connected to the new domain, you cannot get their defined GPO's. What are my options?

                  Jvuz
                  Your probably going to have to touch each machine or develop your script to do it remotely.

                  Comment


                  • #10
                    Re: Remove pc from domain without being connected to DC

                    I think I'll do it with pdq deploy.

                    Comment

                    Working...
                    X