/build/static/layout/Breadcrumb_cap_w.png

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?

0 Comments   [ + ] Show comments

Answers (17)

Posted by: cserrins 13 years ago
Red Belt
0
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.
Posted by: cblake 13 years ago
Red Belt
0
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: Hawzy 13 years ago
Senior Yellow Belt
0
I'll give this a try, I wasn't aware that the scripted install picks up where it left off after a reboot.
Posted by: Hawzy 13 years ago
Senior Yellow Belt
0
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.
Posted by: habsboys 13 years ago
Yellow Belt
0
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
Posted by: cblake 13 years ago
Red Belt
0
habsboys- 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.
Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
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.


::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
Purple Belt
0
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
Red Belt
0
michaelb- Try using Call or Start /wait in your command lines. Eg:
start /wait Name_of_application_install.exe
call batch_file.bat
Posted by: michaelb 13 years ago
Purple Belt
0
ORIGINAL: cblake

michaelb- Try using Call or Start /wait in your command lines. Eg:
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
Second Degree Blue Belt
0
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.


ORIGINAL: michaelb


ORIGINAL: cblake

michaelb- Try using Call or Start /wait in your command lines. Eg:
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
Second Degree Blue Belt
0
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

habsboys- 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.
Posted by: Arcolite 13 years ago
Senior Purple Belt
0
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?
Posted by: cserrins 13 years ago
Red Belt
0
If using the script from our FAQ, make sure the reboot command is set for 45 seconds to give kcleanup.exe time to do its thing.
shutdown -r -t 45
Posted by: Arcolite 13 years ago
Senior Purple Belt
0
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.
Posted by: Arcolite 13 years ago
Senior Purple Belt
0
Problem solved. It's working now!

Our machines seem to need a lot longer than 45 seconds to clean up. Currently I've got the first reboot set to 90 seconds which seems to be working fine.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ