question

Seanlehne-8366 avatar image
0 Votes"
Seanlehne-8366 asked saldana-msft edited

Need to set computername during required required task sequence

We have the task sequence for Windows 10 21H1 as required so we don't get the option to set the computername like when we do it available.

Anyone have any solutions with setting the computer name when setting the deployment as required.

mem-cm-generalmem-cm-osd
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GaryBlok avatar image
0 Votes"
GaryBlok answered
  • If the machine is already in CM, it will grab the same name. So you can pre-populate the machine in CM as a potential solution.

  • You can script with PowerShell a way to dynamically assign the name of the machine, then set the OSDComputerName variable to that dynamic name very early in the TS. (Before the Apply Windows Setting Step

More info about Apply Windows Settings: https://docs.recastsoftware.com/ConfigMgr-Docs/TaskSequence/SCCM-TaskSequence-Step-Apply-Windows-Settings.html

Do you have a naming standard you want applied? Or do you auto generate the name based on Serial Number or something?





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered AllenLiu-MSFT commented

Hi, @Seanlehne-8366
Thank you for posting in Microsoft Q&A forum.

How do you configure your task sequence to get the option to set the computer name?

There is a east way to do that, choose the device collection that your TS will deploy to and view the properties, click the Collection Variables tab and click the Yellow Star icon to define a new variable.
On the new variable window, define the variable. Specify the name as OSDCOMPUTERNAME. Ensure Do not display this value in the Configuration Manager console is checked. Do not specify anything for Value and Confirm, just leave it blank. Click OK.

Now we should get the option to set computer name during OSD.

Here is the details:
https://www.prajwaldesai.com/easy-way-to-prompt-computer-name-during-osd/
(Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It seems there is no update for a couple of days. May we know the current status of the problem? Is there any other assistance we can provide?

0 Votes 0 ·
Seanlehne-8366 avatar image
0 Votes"
Seanlehne-8366 answered GaryBlok commented

On the new variable window, define the variable. Specify the name as OSDCOMPUTERNAME. Ensure Do not display this value in the Configuration Manager console is checked. Do not specify anything for Value and Confirm, just leave it blank. Click OK.

The above only works if you are making the TS available I'm making the TS required so it doesn't honor that setting.

I'm trying to get a pop up of some sort to make the users building the machines the ability to name the machine.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I push required OSD deployments, and it always grabs the machine name and re-applies the same one. (Zero-Touch, full Reimage or Clean Image based on info in CM)
You must have something set that prevents that from happening.

0 Votes 0 ·
Seanlehne-8366 avatar image
0 Votes"
Seanlehne-8366 answered GaryBlok edited

Gary,

Would I be able to just do a Rename-Computer before apply Windows settings and that will work?

Would there be a way to prompt for a variable to rename the machine possibly?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You need to write a PowerShell Script that creates the Name of the computer you want into a Variable, then sets OSDComputerName to that..

Something like:

$Serial = (Get-CimInstance win32_Baseboard).SerialNumber
$SerialLast12 = $Serial.substring($Serial.length - 12, 12)
$OSDComputerName = "PC-$SerialLast12"
$OSDComputerName

115939-image.png


0 Votes 0 ·
image.png (445.0 KiB)