Jump to content


  • 0
anyweb

Setting computername during deployment

Question

how to prompt for Computername during OSD

 

If you want to be prompted for the computername during a deployment (works for the R2 release of SCCM 2007) try the following

 

on your deployment collection, right click and choose modify collection settings

 

create a new variable called OSDComputerName and leave it blank

 

Advertise your task sequence to this collection, but make sure that the Task Sequence is not set to mandatory

 

now, when the Task Sequence executes it will prompt you for the computername during OSD, cool huh ? click on the variable when you see it and enter your desired computername..

 

 

 

Can I script it ?

 

oh and here's another way from the very talented Michael in Denmark smile.gif

 

easy way to change PC name during Deployment

 

and here's a script sample

 

Set env = CreateObject("Microsoft.SMS.TSEnvironment")
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem in colItems
 env("OSDComputerName") = objItem.SerialNumber
next

 

_________________________

 

Just run this script after the Deploy OS step. It will set the SCCM variable "OSDComputername" to the serial, and the rest will take care of it self...

 

 

Related reading:-

 

here's the Technet version of the same

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

I have the exact same problem, the computername that I input during the early stage of the task sequence never gets applied to the computer. After I created an mdt boot image I also get prompted for the computername before selecting the task sequence to run but it never gets applied, the computer is always named minint....

 

Why is it that the computer is never renamed according to the name I input?

Share this post


Link to post
Share on other sites

  • 0

Revrat and Orto

 

Only create a Variable on the SCCM collection with a NULL value and do not create a Task Sequence variable for OSDComputername.

 

By default the TS will check the collection variables and if Null prompt you.

 

I had the same problem and its working great now that I removed the TS variable.

 

Hope this helps

 

PS. We using SCCM R3 with NO MDT

Share this post


Link to post
Share on other sites

  • 0

hi all,

I am using serial number script with MDT 2010 task sequence...i added the script and the variable to the post install phase of the task sequence....but the new deployed machine is not able to get the serial number...

I tested the script with SCCM 2007 and there was no issue.

where to put the script in the mdt task sequence?????

 

thanks ,

pranay.

Share this post


Link to post
Share on other sites

  • 0

here's a quick TIP

 

If you want to be prompted for the computername during a deployment (works for the R2 release of SCCM 2007) try the following

 

on your deployment collection, right click and choose modify collection settings

 

create a new variable called OSDComputerName and leave it blank

 

Advertise your task sequence to this collection, but make sure that the Task Sequence is not set to mandatory

 

now, when the Task Sequence executes it will prompt you for the computername during OSD, cool huh ?

 

 

Pardon the hijacking...

 

Will this also work with SCCM 2012 Beta 2?

 

I tried the steps above, but I was never prompted for the computer name. I added the "Set Task Sequence Variable" right after "Apply Operating System"

 

Thanks.

Share this post


Link to post
Share on other sites

  • 0

just as an update...

 

the script is working fine with MDT 2010...after few changes i figured out that we need to put the script and declare a task sequence variable as OSDCOMPUTERNAME after the first initializing phase of the task sequence....

 

You even don't need the script. You can just run the 'gather' from MDT and then set the variable with %SerialNumber%. The gather will deliver some useful information about your system for finetuning your task sequence. For example applying drivers to several systems you can use the model variable which is read from the BIOS during gather. It's also telling you if the system is a laptop, desktop or virtual pc.

Share this post


Link to post
Share on other sites

  • 0

Hello Everyone, I have been following and using the guides on here to set up an SCCM lab for OSD, (which are amazing, thanks so much Niall for providing this information) I have tested different deployment methods and I am looking at using the unknown computer support, I was able to incorporate one of the scripts to be prompted to specify a computer name, which works great by the way, but I would like to take this step a bit further and have a menu driven selection to create the computer name from the selections made, ie first three digits would be select your location, next would be your business unit and then is it an XP or Win7 machine, is a it a laptop or desktop and then pull in the last 4 or 5 digits from the serial number to generate a unique name. Anyone have any experience or suggestions for something like this?

Share this post


Link to post
Share on other sites

  • 0

I don't know if this would be helpful, but I wrote a powershell script that sets the machine name based on the subnet the computer is sitting on during the imaging process. We have distinct sites and subnets, so this works well. Basically, based on subnet, the first three characters will be the site code (LAV for Las Vegas, NYC for New York City, etc.); the fourth and fifth characters are WW for Windows Workstation; the sixth character will be D for Desktop, N for Notebook or W for Workstation (based on a WMI query); the final seven characters will be the asset tag set in the BIOS (also based on a WMI query). I can post if someone would be interested.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.