Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining Computers to Domain

Status
Not open for further replies.

fpachon

MIS
Feb 9, 2006
22
US
Hi all,
what is the best way to join computers to a domain? We are rolling out a 2003 server in a couple of weeks and want to avoid if possible to sit in front of every PC and join the computer to the domain. I was think that maybe ghosting could help me but that looks like a no show.

Any solutions would be appreciated.

Thanks,

Fabian
 
you are going to have to visit each machine to migrate their profiles from a local to a local domain profile.

but... here is the script to join them to the domain..

-----------------------------------------add_single.vbs

Dim WSHShell

Const JOIN_DOMAIN = 1
Const ACCT_CREATE = 2
Const ACCT_DELETE = 4
Const WIN9X_UPGRADE = 16
Const DOMAIN_JOIN_IF_JOINED = 32
Const JOIN_UNSECURE = 64
Const MACHINE_PASSWORD_PASSED = 128
Const DEFERRED_SPN_SET = 256
Const INSTALL_INVOCATION = 262144

Set WSHShell = CreateObject("WScript.Shell")

'Config this info to match your domain !!!!!!!!!!!!!!!!!!!

'You need an admin account that has rights to
'add computers to the domain
strDomain = "DOMAIN.NAME.COM"
strPassword = "ADMINPASS"
strUser = "ADMINUSERID"

Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName

Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _
strComputer & "'")

ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _
strPassword, strDomain & "\" & strUser, NULL, _
JOIN_DOMAIN + ACCT_CREATE)

WScript.Echo "AD Add Complete. Now Rebooting"
WSHShell.Run "shutdown -r -t 0"


'Quit the Script
WScript.quit

-------------------------------------------------
 
Thanks for the info. So I run this script to at least avoid used the steps under My Computer and so forth. I'll try this out. Will there be a permission problem when I want to copy the local profile to the domain profile?

Thanks.
 
the way we do it.. is

1. migrate the computer onto the domain
2. login to the workstation via the domain. creating a blank local domain profile for the user.
3. add the domiain user to the local list of users (as administrator)
4. Reboot and logon to the machine workstation only via admin and copy the old profile to the new one just created for the domain user.
5. reboot again and login to the domain. You should now have local admin rights and have your old profile on this machine.
 
What about just:

NET COMPUTER \\NewComputerName /ADD

Have you tried that? Will that do what you need?

GVN

 
Client disabled services in 2000 Pro and does not have Admin priv. How can they enable the services without having to give them the admin password. No files are showing in the service folders and they cannot see the property window to enable.
 
we created a specific account to only add new users to the domain.. it has no other rights.

to answer GVN
that command adds and removes named computers from the domain.. it doesnt join the workstations.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top