Share via


Set Computer Name to Serial Number

Question

Wednesday, October 21, 2015 12:09 AM

Hi,

  How do i set the Computername to Serial number in SCCM 2012 R2 ?

  i don't want to use MDT Install method and i have using MDT 2012 and know how to set in ini file.

 But i thought SCCm 2012 R2 got that option to put it easily?

Do i have to create the package and add to TS?

As

All replies (9)

Thursday, October 22, 2015 1:17 AM ✅Answered

go through this post ,it has vbscript to set SN as computer name http://www.windows-noob.com/forums/topic/5543-name-computer-to-serial-number-during-osd/

Eswar Koneti | Configmgr Blog: www.eskonr.com | Linkedin: Eswar Koneti | Twitter: eskonr


Wednesday, October 21, 2015 12:54 AM | 1 vote

You simply need to set the OSDComputerName task sequence variable in the TS before the Apply Windows Settings task. This is typically done with a script. If you search the web, you'll find a ton of examples. Here's a great example from Nikolaj: http://www.scconfigmgr.com/2013/06/03/automate-computer-name-during-osd-in-configmgr-2012-with-powershell/

Jason | http://blog.configmgrftw.com | @jasonsandys


Wednesday, October 21, 2015 5:11 AM

HI Jason,

  Thanks, Just follow the steps and got the error when trying to run this Task 

powershell.exe -noprofile -command "Set-ExecutionPolicy Bypass LocalMachine" -force

I got SCCM 2012 R2 and noticed that boot image does not contain the Powershell component included?

Also noticed that i cannot add to the domain?

As


Wednesday, October 21, 2015 5:31 AM

Are you using ADK 10? PowerShell is (currently) not running that great in WinPE 10.

If not, check the comment section on Nickolaj's Blog Post that Jason linked, there is a little guide on how to add PowerShell to your Boot-Image.

Simon Dettling | msitproblog.com | @SimonDettling


Wednesday, October 21, 2015 5:48 AM

Hi 

No 8.1. When i run the TS for unknown computers i cannot add to the domain?

but same TS apply to Device Collection then i  can added to  the domain?

Just add the PS to boot image and let you know.

As


Wednesday, October 21, 2015 1:50 PM

If powershell is not working for you, then find a VBScript. As mentioned, the link above simply points to an example. Search the web for many many more examples.

Jason | http://blog.configmgrftw.com | @jasonsandys


Wednesday, October 21, 2015 5:30 PM

Very simple to do in customesettings.ini

John Marcum | Microsoft MVP - Enterprise Client Management
My blog: System Center Admin | Twitter: @SCCM_Marcum | Linkedin: John Marcum


Wednesday, October 21, 2015 9:21 PM

i'm not using MDT John

found this on other post 

Yes you can set the machine name without using MDT by either setting OSDComputerName on a collection or in your task sequence if you specify on the TS then i would do very early on before the gather step.

Set OSDComputerName = CLRDP%SERIALNUMBER%

Thanks,
Brandon

where do i set this?

As


Thursday, October 22, 2015 12:02 AM | 1 vote

That's your mistake. ;-)

John Marcum | Microsoft MVP - Enterprise Client Management
My blog: System Center Admin | Twitter: @SCCM_Marcum | Linkedin: John Marcum