Skip to content

Custom Computer Name

Featured Replies

I'm trying to set a custom computer name and I'm almost there. Just need a little help.

 

First, I'm using OSD++ to pop up a Window after the disk partition.

 

osd.jpg

 

I'm using OSD++ During my initial task sequence.

 

osd2.jpg

 

When I take a look at the log file created when using OSD.exe I see the infomation below.

 

osd3.jpg

 

What I'm trying to get is the Computer Name to look like this. MNEP-CND0230TL2 Or, Variable Locationalt1 + SN (when looking at the osd log)

 

So How can I add the Locationalt1 + SN Variable into a new variable called say ComputerName and assign that into the SCCM ts variable OSDCOMPUTERNAME

 

Here is my OSD ConfigFile:

 

<?xml version="1.0" encoding="utf-8"?>

<OSDPlus>

<GetReg hive="HKLM" key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" value="CurrentVersion" varname="CurrentVersion" />

<GetWmi namespace="root\cimv2" class="Win32_ComputerSystem" property="model" varname="csmodel" />

<GetWmi namespace="root\cimv2" class="Win32_BIOS" property="SerialNumber" varname="SN" />

<GetUser title="Computer Name Selection" subtitle="Please Select Your Build Location" icon="74">

<Listbox prompt="Location" icon="45" varname="Location">

<Option alt1="MNEP-">Minnesota Eden Prairie</Option>

<Option alt1="MNWB-">Minnesota Woodbury</Option>

</Listbox>

 

<PutTSVar varname="ComputerName" tsvar="OSDComputerName"/>

 

</GetUser>

</OSDPlus>

 

 

I'm going to add about 20 locations, and we build machines at one primary location and ship them out, and want to have the location prefix for each location + the SN as the name.

 

Am I on the right track?

 

I just built a machine and used <PutTSVar varname="SN" tsvar="OSDComputerName"/> And it still came up as minint, instead of the serial number, but I think that's because my OSD section was in the wrong place. I'm testing it again. OSD does pop up though during the task sequence.

 

Any help would be greatly appreicated.

 

Thanks.

  • 3 months later...

This may be obsolete for the topic starter, but I ran into the same question and thought i could contribute.

 


  •  
  • To get value from a variable, type it with % around.
  • Listbox options are fetched by adding the Option alt appended to the variable.
  • This worked for me with Windows 7 install.
  • I put a empty "Create Task Sequence Variable" for OSDComputerName before
     

 

 

So in you case the XML would look like this (with some cleanup):

 

<?xml version="1.0" encoding="utf-8"?>

<OSDPlus>

<GetWmi namespace="root\cimv2" class="Win32_BIOS" property="SerialNumber" varname="SN" />

 

<GetUser title="Computer Name Selection" subtitle="Please Select Your Build Location" icon="74">

<Listbox prompt="Location" icon="45" varname="Location">

<Option alt1="MNEP-%SN%">Minnesota Eden Prairie</Option>

<Option alt1="MNWB-%SN%">Minnesota Woodbury</Option>

</Listbox>

</GetUser>

 

<PutTSVar varname="Locationalt1" tsvar="OSDComputerName"/>

 

</OSDPlus>

 

I put this between "Partition Disk" and "Apply Operating System" in my Task Sequence.

 

JKV5m.jpg

What is in the Merge Computer Name?

  • 2 weeks later...

What is in the Merge Computer Name?

 

 

Hello, its mainly just a script for making sure the computername is 14 chars... Might be redundant to use, but we had it since before using OSD++.

 

Dim sNewComputerName, oTaskSequence, sOSDComputerName

 

' Populate Task Sequence option values

Set oTaskSequence = CreateObject("Microsoft.SMS.TSEnvironment")

 

' Fetch Task Sequence variables

sOSDComputerName = oTaskSequence("OSDComputerName")

 

' Truncate

sNewComputerName = lcase(left(sOSDComputerName,14))

 

' Send the variable to the Task Sequence

oTaskSequence("OSDComputerName") = sNewComputerName

 

wscript.echo "Set Task Sequence variable OSDComputerName to " & sNewComputerName

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.