Super User is a question and answer site for computer enthusiasts and power users. 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

Alright so not sure if this is entirely possible all in one.

Situation: Brand new computer not on the domain, just a local workgroup. Want to change that computers name, join a domain, and put the computer name in a specific workgroup for that domain. This can all be done via the GUI all at once so it should be hypothetically possible via command line right?

I can rename a local computer using this method: CMD > WMIC COMPUTERSYSTEM where "Name='%computername%'" CALL Rename NEWNAME, Password, User

This works however it requires a restart for the changes to happen.

Next I made a batch file that works great to do what I want using NETDOM, however it can't be used until that computer is restarted due to the name change...

SET /P compname=[promptString]
SET /P org=[promptString]

NETDOM JOIN %compname% /Domain:DOMAIN.NET /OU:%org%,DC=DOMAIN,DC=net /UserD:DOMAIN\user /PasswordD:password /Reboot:15 /verbose
PAUSE

So I guess my question is... is there any way to do this in one way without having to restart? If a restart is absolutely required its too much time consumption; the only reason I want to do this VS using the windows GUI is to get it in the OU I want right away without having to pre-stage or go into AD and move the computer.

share|improve this question

migrated from stackoverflow.com Apr 25 '12 at 12:18

This question came from our site for professional and enthusiast programmers.

    
I read your question; doesn't matter whether it has to be run on a server; it is related to system administration, and so more relevant on serverfault. Don't take it as an offense, but as an indication on where your question belongs to. – CharlesB Apr 24 '12 at 22:31
1  
Server Fault migrate Domain Environment related – JUICED_IT Feb 14 at 5:04

A restart is a must to reflect the changes. Even when you do these things without using cmd, it prompts you to restart your machine. So, its must really be the only way to go about it.

share|improve this answer

Your Answer

 
discard

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