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

did you Add a "Set Task Sequence Variable" to the postinstall phase before the "Apply Windows Settings" step ?

 

 

see the following screenshot, however in this screenshot i'm making the computername=the Asset Tag of the computer

 

all you have to do is to leave the assettag value empty

 

osdcomputername.jpg

Share this post


Link to post
Share on other sites

  • 0

did you Add a "Set Task Sequence Variable" to the postinstall phase before the "Apply Windows Settings" step ?

 

 

see the following screenshot, however in this screenshot i'm making the computername=the Asset Tag of the computer

 

all you have to do is to leave the assettag value empty

 

post-1-12644489834875_thumb.jpg

 

 

I assume %AssetTag% is being set by Gather?

 

Thanks,

 

Mike

Share this post


Link to post
Share on other sites

  • 0

Gather gathers info, see below from the Print Ready Documentation, so it will Gather a value for %AssetTag% from the computers bios, next the task sequence above, that value is assigned in the Set Task sequence variable step, and then this is then used by the Configure command (listed below) or during the Setup Windows and ConfigMgr step

 

if you bring up a command prompt (F8) and browse the c:\windows\panther\unattend\unattend.xml file you can see it gets changed during these steps to the values you selected

 

Gather

This task sequence step gathers data and processing rules for the target computer.

 

Configure

This task sequence step configures the Unattend.xml, Sysprep.inf, or Unattend.txt files with the required property values that are applicable to the operating system you are deploying to the target computer. Following is a brief listing of the settings that show how this step was originally configured in one of the MDT 2010 task sequence templates. For more information about which script accomplishes this task and which properties you use, see ZTIConfigure.wsf.

Share this post


Link to post
Share on other sites

  • 0

if you want to rename the computer without using MDT try the suggestion here

 

join a workgroup at the Apply Network Settings step, I have a Run Command Line using the 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.

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 ?

 

oh and here's another way from the very talented Michael in Denmark :)

 

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
objItem.SerialNumber=env("OSDComputername")

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

 

 

Great post, this has been helpful!!

 

I want to find out if anyone has had any success with creating a custom Task Sequence that renames a computer??

 

For instance, I'm working on a TS that will prompt for a new name, unjoin the machine from the domain to a workgroup, then rejoin with a new name.

 

Thus far I am able to prompt for and obtain the new name either when the TS is launched from PXE by using a TS Variable, or when launched from the Run Advertised Programs control panel applet by using a script to prompt for the name.

 

The point I am at a stall at is when it comes to applying the new name. From what I know the only time the variable for OSDComputerName is paid attention to is during the "Applying Windows Settings" task. However, since this isn't a full OSD TS there seems to be an issue with using this step in my custom TS. There is a Task Sequence error that references this, it's small but I won't paste it in this entry however, I will attach the error to this posting as a text file if anyone is curious.

 

 

This thread has been active on and off so I hope there are still members out there paying attention who might have some ideas on how to get around this or on another method to use. Thanks in advance!

 

 

UPDATE:

My Apologies, everyone. I thought I scanned through this entire article but it appears I did not!

There is a posting by AnyWeb on Feb 23rd that provides an option to perform just what I'm trying to do by using a third party name changing tool.

 

These forums are extremely helpful. Thanks again!

TaskSequenceError.txt

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.