Rename the computer and Join it to Domain
I'm using the K2000 appliance to deploy scripted installations of WinXP SP3 and I'm using the following KACE KB article to do the rename and join thing.
http://www.kace.com/support/kb/index.php?action=artikel&cat=54&id=763&artlang=en
I've got it setup and working so that after the first post-install reboot, the computer is named as the Dell Service Tag and is able to login to our domain.
The problem I'm experiencing is twofold. Since there is no reboot in between the name change and the domain join, the computer is being added to AD with the randomly generated Windows XP name. And on top of that, when the KBOX 1000 Agent is installed, it is also uploading to inventory under the Win XP randomly generated name.
So that gets to my main question: Is there any way to use WSNAME during the Kbox Boot Environment portion of the post install? Or possibly to chain an additional reboot to the end of the post Boot Environment Postinstall section just for joining the domain and uploading to the K1000 inventory?
http://www.kace.com/support/kb/index.php?action=artikel&cat=54&id=763&artlang=en
I've got it setup and working so that after the first post-install reboot, the computer is named as the Dell Service Tag and is able to login to our domain.
The problem I'm experiencing is twofold. Since there is no reboot in between the name change and the domain join, the computer is being added to AD with the randomly generated Windows XP name. And on top of that, when the KBOX 1000 Agent is installed, it is also uploading to inventory under the Win XP randomly generated name.
So that gets to my main question: Is there any way to use WSNAME during the Kbox Boot Environment portion of the post install? Or possibly to chain an additional reboot to the end of the post Boot Environment Postinstall section just for joining the domain and uploading to the K1000 inventory?
0 Comments
[ + ] Show comments
Answers (17)
Please log in to answer
Posted by:
bthai
8 years ago
Posted by:
cserrins
14 years ago
The FAQ you point to is valid. However, the scripts are set to reboot between the naming of the computer and joining of the domain so it is interesting that this is not happening for you. If you call in to support and ask for me we can do a webex, but I would check your script. Also, this script should be run as the last post installation.
Another option is to join the domain from the scripted install unattend file, and then use wsname with the /rcid (rename computer in domain) switch, this works quite well.
Lastly, for your agent, add:
-clone_prep=true
at the end, this will make it so that the agent installs but does not register its kuid with the k1000 until after the next reboot.
Another option is to join the domain from the scripted install unattend file, and then use wsname with the /rcid (rename computer in domain) switch, this works quite well.
Lastly, for your agent, add:
-clone_prep=true
at the end, this will make it so that the agent installs but does not register its kuid with the k1000 until after the next reboot.
Posted by:
cblake
14 years ago
Posted by:
Hawzy
14 years ago
Posted by:
Hawzy
14 years ago
Finally got this working, with the reboot scripts. I found that if the Join domain task was too soon after the reboot, that the rename wouldn't take effect correctly.
Just in case anyone else was having this problem. For a scripted Installation the order I used was:
Rename Computer as Service Tag
Reboot Computer 1
Install program
Install program
Install program
Install program
Install program
Install program
Install program
Join Domain
Reboot Computer 2
Post Domain join install stuff.
Just in case anyone else was having this problem. For a scripted Installation the order I used was:
Rename Computer as Service Tag
Reboot Computer 1
Install program
Install program
Install program
Install program
Install program
Install program
Install program
Join Domain
Reboot Computer 2
Post Domain join install stuff.
Posted by:
habsboys
13 years ago
Posted by:
cblake
13 years ago
Posted by:
dyehardfan
13 years ago
The only way this works in Win7 is if you also inject the registry keys to kick off the next step of your post-install procedure. This works fine in Windows XP.
I use a modified form of a batch file/vbscript combination to rename the computers and join the domain as a post installation task. You need to make sure you have the proper amount of reboot to administrator accounts set in your unattend.xml file or sysprep.inf.
I use the following to copy the contents of a folder onto the local machine which contains wsname, 2 batch files, a .vbs script and my namedb.dat file for wsname.
wsname_x86.bat:
JoinDomain_x86.bat:
I eventually want to write this all as .vbs, but do to time and learning curve most of my more complicated installs are a mixture of .bat and .vbs for now.
I use a modified form of a batch file/vbscript combination to rename the computers and join the domain as a post installation task. You need to make sure you have the proper amount of reboot to administrator accounts set in your unattend.xml file or sysprep.inf.
I use the following to copy the contents of a folder onto the local machine which contains wsname, 2 batch files, a .vbs script and my namedb.dat file for wsname.
::Copy Files to Local Machine and Begin Actions
robocopy NameJoin c:\NameJoin *.* /E
c:\NameJoin\wsname_x86.bat
wsname_x86.bat:
::Rename Computers Based on BIOS Serial Number
c:\source\wsname.exe /RDF:"c:\source\namedb.dat" /DFK:$SERIALNUM
::Write Registry Key to Run Join Domain Script After Reboot
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"C:\source\JoinDomain_x86.bat\"" /f
::Reboot Computer
shutdown -r -t 5
JoinDomain_x86.bat:
::Pass Domain Admin Credentials to Join_Domain.vbs
::<Domain> <Account> <Account PW> <DNS Server>
C:\source\Join_Domain.vbs SomeDomain SomeAccount AccountPW
::Write Registry Key to Delete C:\Source and it's Contents After Reboot
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"rd /s /q C:\source\""
::Write Registry Key to Begin Post Scripted Install Scripted Installs
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"postScripted.vbs\"" /f
::Reboot Computer
shutdown -r -t 5
I eventually want to write this all as .vbs, but do to time and learning curve most of my more complicated installs are a mixture of .bat and .vbs for now.
ORIGINAL: cblake
If reboots are the issue, I usually build a few reboot task personally.
shutdown -r -f -t 10 does the trick for my scripted installs. I just insert a task with that command after the rename, and again after the join domain. Hope that helps.
Posted by:
michaelb
13 years ago
ORIGINAL: habsboys
We are buying a k2000 to deploy win7 to 1000 new Dell PC's. Does any one have a simple step by step guide on how to change the computers name and add it to the domain.
I ma not an expert with scripts and a example script woul sbe great and how to import into the scripted installation for this build
I have been having exactly the same issue that you had been by the sounds of things....
I am trying to install one driver via the post install tasks, then change the name, reboot then add the kbox agent, then add to the domain, but it does not seem to work correctly. All tasks seem to try and run at once meaning that the kbox install and the drivers do not install, to top things off the machine is not picked up in AD even though it states it has joined the domain on the workstation....
Any ideas?
Posted by:
cblake
13 years ago
start /wait Name_of_application_install.exe
call batch_file.bat
Posted by:
michaelb
13 years ago
ORIGINAL: cblake
- Try using Call or Start /wait in your command lines. Eg: michaelb
start /wait Name_of_application_install.exe
call batch_file.bat
thanks, this could help....
it just seems to be the adding the machine to the domain that i am having the issue with at the moment. What would i put in this instance? in the task command line it states call start_x86.bat. would i therefor put: call / wait start_x86.bat? if so how long would it wait for?
Have you had any issues before where the workstation changes the name and tits added to the domain, i.e it is a member of the domain but does not show up in AD nor am i able to log onto the network?
Thanks
Mike
Posted by:
dyehardfan
13 years ago
I hate to ask this, but you have modified the scripts to use a domain account with the proper credentials to add the machine to the domain, correct?
Also, is there a reason for waiting for the reboot to install the kbox agent?
Also, you don't want to start /wait a script file. It will usually open up a second command window that has to be manually exited. You typically want to Call a script file and use Start /Wait when dealing with an msi install or a setup.exe install.
Also, is there a reason for waiting for the reboot to install the kbox agent?
Also, you don't want to start /wait a script file. It will usually open up a second command window that has to be manually exited. You typically want to Call a script file and use Start /Wait when dealing with an msi install or a setup.exe install.
ORIGINAL: michaelb
ORIGINAL: cblake
- Try using Call or Start /wait in your command lines. Eg: michaelb
start /wait Name_of_application_install.exe
call batch_file.bat
thanks, this could help....
it just seems to be the adding the machine to the domain that i am having the issue with at the moment. What would i put in this instance? in the task command line it states call start_x86.bat. would i therefor put: call / wait start_x86.bat? if so how long would it wait for?
Have you had any issues before where the workstation changes the name and tits added to the domain, i.e it is a member of the domain but does not show up in AD nor am i able to log onto the network?
Thanks
Mike
Posted by:
dyehardfan
13 years ago
If you just use a naming rule and then run the join domain script, without a reboot in between, are you not going to run into the problems these guys are describing?
ORIGINAL: cblake
- Rename computer task is typically a WSNAME task. WSNAME is a public utility and is bundled onto your K2000 ("Create new naming rule" postinstall task) for the purpose of naming machines with either criteria or an answer file. Join domain is a script that is also provided. There are countless alternate methods, but the one on the K2 is pretty universal in my experience. Your K2000 will also have training with it when you purchase; a trainer (maybe me!) will lead you through all of this. habsboys
Posted by:
Arcolite
13 years ago
I'm also having issue with this.
Currently I have my image sysprep'd with 3 AutoLogins and set to join a Workgroup.
Then Post Installation Tasks are:
- Rename Computer (Naming Rule - wsname.exe /RDF:namedb.dat /DFK:$MAC /NOREBOOT /LOGFILE:C:\namechange.txt)
- Restart 1 (BAT Script)
- Join Domain (Duplicate of the Join Domain Example but edited with our credentials)
- Restart 2 (BAT Script)
This appears to work. The computer gets renamed and from the computers side of things it looks like it has joined the domain. However you are unable to pull down any GPO's and you can only log in locally not onto the Domain.
If you then check the Computers OU I find that it has joined with the old name.
I then tried adding a Pause between the first Restart and Join Domain task.
Firstly using sleep.exe from the W2K3 Resource Kit setup as an Application and using "sleep.exe 120" for the command line. Then I tried a simple BAT task using a local loopback PING command (PING -n 61 127.0.0.1>nul)
Both of these attempts causes the Post Installation tasks to cease running after the first Restart.
I then tried using the script from the first post (http://www.kace.com/support/kb/index.php?action=artikel&cat=54&id=763&artlang=en). This works. It renames and joins the domain properly....but it doesn't clean up the machine. The KACE folder and the kcleanup.exe is still on the machine.
Any suggestions for what am I doing wrong?
Currently I have my image sysprep'd with 3 AutoLogins and set to join a Workgroup.
Then Post Installation Tasks are:
- Rename Computer (Naming Rule - wsname.exe /RDF:namedb.dat /DFK:$MAC /NOREBOOT /LOGFILE:C:\namechange.txt)
- Restart 1 (BAT Script)
- Join Domain (Duplicate of the Join Domain Example but edited with our credentials)
- Restart 2 (BAT Script)
This appears to work. The computer gets renamed and from the computers side of things it looks like it has joined the domain. However you are unable to pull down any GPO's and you can only log in locally not onto the Domain.
If you then check the Computers OU I find that it has joined with the old name.
I then tried adding a Pause between the first Restart and Join Domain task.
Firstly using sleep.exe from the W2K3 Resource Kit setup as an Application and using "sleep.exe 120" for the command line. Then I tried a simple BAT task using a local loopback PING command (PING -n 61 127.0.0.1>nul)
Both of these attempts causes the Post Installation tasks to cease running after the first Restart.
I then tried using the script from the first post (http://www.kace.com/support/kb/index.php?action=artikel&cat=54&id=763&artlang=en). This works. It renames and joins the domain properly....but it doesn't clean up the machine. The KACE folder and the kcleanup.exe is still on the machine.
Any suggestions for what am I doing wrong?
Posted by:
cserrins
13 years ago
Posted by:
Arcolite
13 years ago
Hi Corey,
I'm using the script from the FAQ as is (which already has 45 seconds pause on the reboot), the only things I've changed are:
- Changed the Default Password fort he AutoLogin reg entries make the local machine administrator password
- Making the wsname use a .dat file to for the names of our machines which is matched on MAC
- Added our domain credentials to the Join Domain batch.
With these changes and only this Post Installation Task added to the image the workstation will get renamed and join the domain correctly, however kcleanup.exe and the KACE folder are left behind. C:\Source however has been removed.
I'm using the script from the FAQ as is (which already has 45 seconds pause on the reboot), the only things I've changed are:
- Changed the Default Password fort he AutoLogin reg entries make the local machine administrator password
- Making the wsname use a .dat file to for the names of our machines which is matched on MAC
- Added our domain credentials to the Join Domain batch.
With these changes and only this Post Installation Task added to the image the workstation will get renamed and join the domain correctly, however kcleanup.exe and the KACE folder are left behind. C:\Source however has been removed.
Posted by:
Arcolite
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.