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!
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
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