/build/static/layout/Breadcrumb_cap_w.png

HOW TO: Change Rename Set Computer Name WITHOUT wsname or MAC address

 

the idea is simple:
name the computer using a text file containing a list of all desired computer names.  we do not want to rely on wsname and we do not want to keep track of any MAC addresses.  also, we want the computer to be named properly before joining the domain.  finally, we want the name to be changed before postinstallation (Windows boot).

what you need:
1.  Kace K2000
2.  a computer
3.  folders created under the Kace network share
4.  ssr.exe, findstr.exe and findstr.exe.mui
5.  a text file containing a list of computer names
6.  the following line present in the Kace Setup Configuration (unattend.xml):  <ComputerName>*</ComputerName>
7.  K2000 scripted install for Windows 7
8.  the below script

batch script:
net use z: \\k2000\restore\computers /user:admin password
z:
set /p name=<list.txt
bin\ssr -f C:\Windows\Panther\unattend.xml -o C:\Windows\Panther\unattend2.xml -s * -r %name%
move /y C:\Windows\Panther\unattend2.xml unattend.xml
bin\findstr /v %name% list.txt>list2.txt
move /y list2.txt list.txt
echo %name%>>done.txt
net use z: /delete /y
y:

how it works:
1.  the above script is created as a K2000 Boot Environment postinstallation task
2.  the script reads list.txt and captures the first computer name from the top of the list
3.  the captured name is inserted into the unattend.xml file and replaces the * character
4.  the captured name is automatically removed from list.txt and added to done.txt
5.  when mini-setup runs, it uses the modified unattend.xml file which contains the new computer name

steps:
1.  create folder called "computers" under \\k2000\restore\
2.  create folder called "bin" under \\k2000\restore\computers\
3.  create folder called "en-US" under \\k2000\restore\computers\bin\
4.  download ssr.exe tool from website in the Credits section below
5.  copy ssr.exe into \\k2000\restore\computers\bin\
6.  copy C:\Windows\System32\findstr.exe into \\k2000\restore\computers\bin\
7.  copy C:\Windows\System32\en-US\findstr.exe.mui into \\k2000\restore\computers\bin\en-US\
8.  create a file called list.txt that contains all computer names (1 name per line) and save under \\k2000\restore\computers\
9.  create the above K2000 Boot Environment task and add as the last KBE task in the scripted install

warnings:
1.  if you want certain computers to pickup certain computer names, you need to initiate the scripted install for each computer in the same order as the desired names appear in list.txt.  the first computer to reach mini-setup will get the first name on the list, the second computer will get the second name on the list, etc.  for this reason, you also want to wait at least 30 seconds in-between the launching of each scripted install.
2.  in line 1 of the script, make sure to adjust the admin username and password according to your setup
3.  if you prefer not to use the Kace share, you can use any network share you want, just make sure to adjust line 1 of the script
4.  always make sure list.txt is populated during deployments otherwise the script will error out
5.  i'm sure my script can be cleaned up and made more efficient, but i'll leave that task up to you guys :)

Credits:
credit goes to Ross MacGregor for his SSR utility.  Thank you Ross!
https://sites.google.com/site/simplesearchreplace/

It took me a couple days to come up with this method so please let me know what you guys think.  Thank you!


Comments

  • Nice write up. Just curious how are you naming your machines? Are they incrementing (Computer1,Computer2,etc...) - dchristian 12 years ago
  • Thank you dchristian. We are using our internal asset tags (stickers that we slap on each box). The stickers come in a huge roll and increment 1 digit at a time. We also append the department code on the end of that, plus D or L for desktop or laptop. - bthai 12 years ago
    • Ok that makes sense. How are you handling re-imaged machines? Do they keep their original name or are they assigned a new name? - dchristian 12 years ago
      • they would keep the same name unless the box is repurposed for a different dept., at which point the dept code in the name would change. - bthai 12 years ago
  • - bthai 12 years ago
  • I'am having problems with this. I make everyhting like described in first post, but I get "windows system error 1219 has occurred"

    I understood that task have to be Postinstallation Task and runtime environment K2000 KBE.

    I googled what that error means, but I have no idea how to fix it... - velho 12 years ago
    • velho - sorry you had trouble, please read the top of my blog post as I have adding some updates. my post doesnt display properly on IT NINJA all of a sudden so I converted it to PDF. Thanks - bthai 12 years ago
      • It looks like IT NINJA fixed the problem that was messing with my blog post where formatting and lines were missing. All is good now. - bthai 12 years ago
  • Two Big issues so far with your Bat script.
    In line 5 you need to provide the full directory to the unattend.xml.
    For your example line 5 would need to be:
    "move /y C:\Windows\Panther\unattend2.xml C:\Windows\Panther\unattend.xml"
    Second Issue is in line 6, It would be better to use double ">"
    For your example line 6 would need to be:
    "bin\findstr /v %name% list.txt>>list2.txt"

    We are running this right now and will let you know of anything else we find. Thanks for the work and examples though! - adam.paul88 11 years ago
  • I have a similar script that I run. Works fine on Win7 32bit, but not on 64? - saavy_d 9 years ago
This post is locked

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