OSD Computer Name
I have seen quite a few posts here about setting the computer name by prompting the user and/or using the MDT.  My goal is to do bare-metal, "unknown" builds that assign the computer name to be the serial number from the BIOS.  All our machines are Dell.  I would like to not have to integrate the MDT if possible, but if the MDT is the only way to do it, so be it.

Thanks in advance.
February 23rd, 2010 1:57pm

Simple! In the Task Sequence add a step right before Apply Window Settings by adding a new step Set Task Sequence Variable and in the "Task Sequence Variable" set OSDComputerName and below set %SERIALNUMBER%
As simple as that! :)
Good luck
PS: No need to use MDT.
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2010 2:05pm

So I tried it that way and it did not work.  Here is what the output of the "Apply Windows Settings" task was:

 ============================[ OSDWinSettings.exe ]============================ Command line: "osdwinsettings.exe" /config Setting %SystemRoot% to "C:\Windows" Loading existing answer file "C:\Windows\panther\unattend\unattend.xml" Computer Name: %SERIALNUMBER% Getting namespace "Microsoft-Windows-Shell-Setup" for architecture "x86" Registered Owner: Admin Getting namespace "Microsoft-Windows-Shell-Setup" for architecture "x86" Registered Organization: Company, Inc. Time Zone: Eastern StandardTime Time zone: Eastern Standard Time The OSDProductKey variable is not set in the environment.  Not setting the product key in the unattend answer file. Setting local admin password. Writing configuration information to C:\Windows\panther\unattend\unattend.xml Successfully saved configuration information to C:\Windows\panther\unattend\unattend.xml Exiting with return code 0x00000000

It looks like it was actually trying to use %SERIALNUMBER% as the computer name.  Shortly after that, I got errors in the postinstall that said that Windows setup could not continue and to press OK to reboot and restart the installation.
February 23rd, 2010 2:39pm

... (it's official... I just hate the proxy I have between me and the internet).
Did you added the Set Task Sequence Variable step before the Apply Windows Settings step as I said, or you did just... "injected" the %SERIALNUMBER% directly into Apply Windows Settings step?
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2010 3:14pm

I created the Set Task Sequence Variable step before Apply Windows Settings step... I wouldn't know how to "inject" the %SERIALNUMBER% into the Apply Windows Settings step if I wanted to...

2/23/2010 9:27:39 AM   4   Apply Operating System   Install Operating System   11134   The task sequence execution engine successfully completed an action   0   oint path [C:\programdata\Documents] Fixing junction point path [C:\programdata\Favorites] Fixing junction point path [C:\programdata\Start Menu] Fixing junction point path [C:\programdata\Templates] Setting %SystemRoot% to "C:\Windows" Getting namespace "Microsoft-Windows-Deployment" for architecture "x86" Getting namespace "Microsoft-Windows-Shell-Setup" for architecture "x86" Getting namespace "Microsoft-Windows-International-Core" for architecture "x86" Writing configuration information to C:\Windows\panther\unattend\unattend.xml Successfully saved configuration information to C:\Windows\panther\unattend\unattend.xml Image installation completed sucessfully. Closing image file \\SCCM.DOMAIN.LOCAL\SMSPKGD$\MA10003F\win7ent.wim Entering ReleaseSource() for \\SCCM.DOMAIN.LOCAL\SMSPKGD$\MA10003Freference count 1 for the source \\SCCM.DOMAIN.LOCAL\SMSPKGD$\MA10003F\ before releasing Released the resolved source \\SCCM.DOMAIN.LOCAL\SMSPKGD$\MA10003F\ 
 2/23/2010 9:27:39 AM   5   Set Computer Name to Service Tag   Install Operating System   11134   The task sequence execution engine successfully completed an action   0   Finished with error code 0 
 2/23/2010 9:27:40 AM   6   Apply Windows Settings   Install Operating System   11134   The task sequence execution engine successfully completed an action   0   ============================[ OSDWinSettings.exe ]============================ Command line: "osdwinsettings.exe" /config Setting %SystemRoot% to "C:\Windows" Loading existing answer file "C:\Windows\panther\unattend\unattend.xml" Computer Name: %SERIALNUMBER% Getting namespace "Microsoft-Windows-Shell-Setup" for architecture "x86" Registered Owner: Admin Getting namespace "Microsoft-Windows-Shell-Setup" for architecture "x86" Registered Organization: Company, Inc. Time Zone: Eastern StandardTime Time zone: Eastern Standard Time The OSDProductKey variable is not set in the environment.  Not setting the product key in the unattend answer file. Setting local admin password. Writing configuration information to C:\Windows\panther\unattend\unattend.xml Successfully saved configuration information to C:\Windows\panther\unattend\unattend.xml Exiting with return code 0x00000000 
February 23rd, 2010 3:29pm

And the variable you've set was OSDComputerName? It is quite strange that that step doesn't work, since I'm using it without no problem.
Try to follow the steps in the next link: http://www.windows-noob.com/forums/index.php?/topic/1133-setting-computername-during-deployment/#entry5374
Oh .. forget what I've said before... You will need MDT.
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2010 3:41pm

why don't you just create a vb script that reads the serial number from the BIOS by using WMI query and injects it into the sysprep.inf (assuming you are doing Windows XP deployment) just after the "Apply Network Settings" step?
February 23rd, 2010 4:14pm

I'm actually doing a Windows 7 deployment, and I found a solution where I join a workgroup at the Apply Network Settings step, I have a Run Command Line using wsname.exe command to change the name after the Setup Windows and ConfigMgr step and then a Join Domain or Workgroup step after that to join it to the domain.
  • Marked as answer by .Tim Harrison Tuesday, February 23, 2010 6:16 PM
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2010 5:00pm

I'm actually doing a Windows 7 deployment, and I found a solution where I join a workgroup at the Apply Network Settings step, I have a Run Command Line using wsname.exe command to change the name after the Setup Windows and ConfigMgr step and then a Join Domain or Workgroup step after that to join it to the domain.
  • Marked as answer by .Tim Harrison Tuesday, February 23, 2010 6:16 PM
February 23rd, 2010 5:00pm

I'm actually doing a Windows 7 deployment, and I found a solution where I join a workgroup at the Apply Network Settings step, I have a Run Command Line using wsname.exe command to change the name after the Setup Windows and ConfigMgr step and then a Join Domain or Workgroup step after that to join it to the domain.
  • Marked as answer by .Tim Harrison Tuesday, February 23, 2010 6:16 PM
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2010 5:00pm

OK, this worked for me!

But I would like to add extra caracters to the computer name, before the serial number.

Anyway to do that?

November 25th, 2010 1:38pm

You could put the characters you require before the % sign. lets say you needed to put DELL- before the variable, you'd have to do DELL-%SERIALNUMBER%

 

I haven't tested it as I haven't needed it yet. Bu if I even get a chance to test it I'll update this post.

 

Free Windows Admin Tool Kit Click here and download it now
November 9th, 2011 6:08am

Hi

I am new to SCCM and would like to accomplish the same thing that you are asking...I have tried the steps listed above with no luck.

Can you please tell me in detail how you were able to accomplish this?

I am attempting to rename the computer name on a Windows 7 x64bit but the computer name never changes....same ol minint-xxxx.

I am not using MDT and would like to be able to add a TS to rename the computer to the following format example: ABCserialnumber

So first 3 letters would be pre-defined and the remaining would be the serial number from the BIOS.

Since alot of these postings are old I am wondering if anything has changed to help us newbies accomplish this?

 

 

January 26th, 2012 5:41pm

I've been removing MDT from our OSD Task Sequences the past few weeks. Our server is SCCM 2012 R2 CU3.

If you want to use OSDComputerName to rename computer in SCCM OSD TS (Operating System Deployment - Task Sequence) without using MDT (Microsoft Deployment Toolkit) then you need your Task Sequence to be in the following order:

Install Operating System
- Restart into Windows PE
- Partition Disk - BIOS/UEFI
- Apply Operating System
- Apply Windows Settings
- Set OSDComputerName Task Sequence Variable (value: %SERIALNUMBER%)
- Apply Network Settings (you can Join a domain here)
- Apply Device Drivers
Setup Operating System
- Setup Windows and Configuration Manager
Install Tier 1 Apps
.......etc

Tim H, the reason you're getting the unattend sysprep error message is due to incorrect information earlier in this thread. Note that in my above order, OSDComputerName is added AFTER 'Apply Windows Settings' and BEFORE 'Apply Network Settings'.

This specific order of tasks requires no MDT and no sysprep unattend.txt answer file, and no wsname.exe! That is, a completely script-free, native SCCM solution out of the box... the way it should be!

Regards



  • Proposed as answer by TechNetPete Thursday, November 20, 2014 4:11 AM
  • Edited by TechNetPete Thursday, November 20, 2014 4:24 AM
Free Windows Admin Tool Kit Click here and download it now
November 20th, 2014 4:11am

I've been removing MDT from our OSD Task Sequences the past few weeks. Our server is SCCM 2012 R2 CU3.

If you want to use OSDComputerName to rename computer in SCCM OSD TS (Operating System Deployment - Task Sequence) without using MDT (Microsoft Deployment Toolkit) then you need your Task Sequence to be in the following order:

Install Operating System
- Restart into Windows PE
- Partition Disk - BIOS/UEFI
- Apply Operating System
- Apply Windows Settings
- Set OSDComputerName Task Sequence Variable (value: %SERIALNUMBER%)
- Apply Network Settings (you can Join a domain here)
- Apply Device Drivers
Setup Operating System
- Setup Windows and Configuration Manager
Install Tier 1 Apps
.......etc

Tim H, the reason you're getting the unattend sysprep error message is due to incorrect information earlier in this thread. Note that in my above order, OSDComputerName is added AFTER 'Apply Windows Settings' and BEFORE 'Apply Network Settings'.

This specific order of tasks requires no MDT and no sysprep unattend.txt answer file, and no wsname.exe! That is, a completely script-free, native SCCM solution out of the box... the way it should be!

Regards



  • Proposed as answer by TechNetPete Thursday, November 20, 2014 4:11 AM
  • Edited by TechNetPete Thursday, November 20, 2014 4:24 AM
November 20th, 2014 4:11am

I've been removing MDT from our OSD Task Sequences the past few weeks. Our server is SCCM 2012 R2 CU3.

If you want to use OSDComputerName to rename computer in SCCM OSD TS (Operating System Deployment - Task Sequence) without using MDT (Microsoft Deployment Toolkit) then you need your Task Sequence to be in the following order:

Install Operating System
- Restart into Windows PE
- Partition Disk - BIOS/UEFI
- Apply Operating System
- Apply Windows Settings
- Set OSDComputerName Task Sequence Variable (value: %SERIALNUMBER%)
- Apply Network Settings (you can Join a domain here)
- Apply Device Drivers
Setup Operating System
- Setup Windows and Configuration Manager
Install Tier 1 Apps
.......etc

Tim H, the reason you're getting the unattend sysprep error message is due to incorrect information earlier in this thread. Note that in my above order, OSDComputerName is added AFTER 'Apply Windows Settings' and BEFORE 'Apply Network Settings'.

This specific order of tasks requires no MDT and no sysprep unattend.txt answer file, and no wsname.exe! That is, a completely script-free, native SCCM solution out of the box... the way it should be!

Regards



  • Proposed as answer by TechNetPete Thursday, November 20, 2014 4:11 AM
  • Edited by TechNetPete Thursday, November 20, 2014 4:24 AM
Free Windows Admin Tool Kit Click here and download it now
November 20th, 2014 4:11am

thanks for great post Pete. Wondering if you can help me achieve this:

1. Surface Pro3

2. SCCM 2012 R2

Task Sequence:

  1. Partition Disk 0 - UEFI
  2. Pre-provision BitLocker
  3. Apply OS
  4. Apply Windows Settings
  5. Set ComputerName (OSDComputerName; Value=%serialnumber%)
  6. Apply Network Settings
  7. Apply SurfacePro drivers
  8. Setup Windows and ConfigMgr
  9. Enable BitLocker

I wish to achieve the computer name in this format: 0000A-T(8characters of serial number from the right). As you see, the first 4characters are domain reference followed by a hyphen, then "T" for tablet and followed by 8 characters of the serial number from right.

In the past, I was able to achieve this for any BIOS based machines using a MDT settings INI file with below value for OSDComputerName=XXXA-T#Right(replace("%AssetTag%"),8)# 

However, with UEFI I'm running out of luck. As much possible, I wish to avoid going back to the MDT route if the above can be achieved from TS wizard alone. 

Any thoughts will be greatly appreciated. 

July 8th, 2015 10:06pm

Looks like there are some good answers listed here. I thought I'd share the way I accomplish this. In my TS after "restart in WinPE" I add a step called "Prompt for Computer Name" command line and run this VBS:

set env = CreateObject ("Microsoft.SMS.TSEnviroment")

Name = inputbox ("Rename Computer", "Please enter the new computer name below:",env("_SMSTSMachineName"),400,0)

env("OSDComputerName") = Name

Then have an "Apply Network Setting" task and check the "Join a domain" radio button. Input your domain in the "Domain" box and put your AD Location in the "Domain OU" box. Then choose and account that has rights to join the machine to the domain.

Free Windows Admin Tool Kit Click here and download it now
August 4th, 2015 10:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics