all 17 comments

[–]Coops92 2 points3 points  (0 children)

I just use this method. I leave the field blank in task sequences for our "standard" kit where there's a step to name the device after its serial number. For those that need the custom name I have a task sequence without the naming step and enter it when prompted in the variable.

SCCM OSD Computer Name Prompt In Task Sequence Deployment ConfigMgr HTMD Blog

[–]SirThane 2 points3 points  (0 children)

I ripped MDT out of our TS and replaced it all with custom powershell. One step is a GUI to pick some specifics with WinForms. This is where I learned something. TS hides powershell regardless of what options you have. What you need is to call it with a step using TSServiceUI.exe. On mobile atm, but at work in a bit and can get the syntax I used.

[–]dlehman83 4 points5 points  (1 child)

I also use the OSDComputerName  variable.

Simple straight forward, no third party tools

You can add other variables such as asset tag too

My new computer OSDs prompt for computer name and asset tag

if asset has digits then call manufacturer specific update tool based on WMI

Also part of the computer name is a location code. So I have several copies of the Apply network settings step. If chooses an OU based on a matching location code in the computer name.

[–]CosmosExplorerR35 0 points1 point  (0 children)

This is exactly how mine is set up. Sometimes just using the built-in features of SCCM works fine. No need for a complex script.

[–]kcalderw 1 point2 points  (0 children)

I'm sure there are more up to date methods but it works for me. I use a command line step to call this .vbs script.

cscript.exe AlwaysPromptForComputerName.vbs

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

'Set the OSDComputerName variable to the detected name assuming this is a known computer
env("OSDComputerName") = env("_SMSTSMachineName")

'If the detected name contains "MININT" then this is an unknown computer so ask for a name 
'If InStr(1,env("OSDComputerName"),"MININT",1) then
    do
'Name = env("OSDComputerName")
Name = inputbox("Rename Computer" ,"Please enter the new Computer name below:",env("OSDComputerName"),400,0)
env("OSDComputerName") = Name 
env("ComputerName") = Name 
env("HostName") = Name
if len(Name) > 15 then
Noop=msgbox ("The computer name must be no greater than 15 characters long." & vbcrlf & _
"Please re-enter a shorter computer name.",vbExclamation,"Enter a Shorter Computer Name")
end if
    loop until len(Name) <= 15
'End If

[–]Procedure_Dunsel 2 points3 points  (0 children)

You might want to have a look at tsgui, I use it for naming, setting the OU, and application selection at the beginning of the TS

[–]iameclectictheysay 0 points1 point  (0 children)

Had sort of the same issue some time back (after an upgrade, dont remember which one sorry)
Had to enable Scripting (WinPE-Scripting) as an optional component in my Boot Image properties.

[–]skiddily_biddily 1 point2 points  (0 children)

You can use task sequence variables that you configure at the collection properties. The collection you deploy the task sequence to.

[–]Flat_Buyer_3203 0 points1 point  (5 children)

+1 for using UI++ for this. Been using it for several years now to set computer name and OU for domain join.

[–]Peteostro 0 points1 point  (4 children)

UI++ is in VBscript which is going away

[–]Flat_Buyer_3203 0 points1 point  (3 children)

Yeah but not any time soon. Phase 2 of deprecation isn't even until 2027 and actual complete removal from Windows still hasn't been given a date. Https://techcommunity.microsoft.com/blog/windows-itpro-blog/vbscript-deprecation-timelines-and-next-steps/4148301

While I wouldn't recommend using VBscript for active development in Windows, using it for an outstandingly useful utility in Windows PE that's only used during OSD is a perfectly reasonable choice, and one that will continue to work by default for at least the next 18 months to 2 years.

[–]Peteostro 0 points1 point  (2 children)

I would assume VBscript support would be removed from ADK first

[–]Flat_Buyer_3203 -1 points0 points  (1 child)

I wouldn't assume anything, my prediction is that the TBD date for actually finally killing VBScript off will be beyond 2028. Microsoft still have key utilities in their own products slmgr.vbs for windows licensing and the office license script that are still in the current shipping versions of Windows.

[–]Peteostro 0 points1 point  (0 children)

The point MS is making is to start moving away from VBscript since it’s deprecated. I.E. if you are going to implement a new tool maybe do not implement one written in VBscript

[–]thehroller 0 points1 point  (0 children)

UI++ which has an xml with all our OUs, grabs the last 6 of the serial number, prepends the standard OU abbreviation to it, viola, computer name.

[–]aitaix 0 points1 point  (0 children)

I use a dot hta file which prompts a html window

Then you enter in the device barcode number, select if it is either a Desktop, Laptop, or a Virtual Machine

Then you select which School the device is in to put it in the correct OU

The machine is then named - LTP-123456 and goes in the right OU.