VBScript to set OSDComputerName to systems serial number during OSD in SCCM

From The IT Community
Jump to: navigation, search




A VBScript to set OSDComputerName to the systems serial number during OSD in SCCM:

Use the following VB script in your Task Sequence:

Dim env, strComputer

strComputer = "."

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

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS")

For Each objBIOS in colSettings
    env("OSDComputerName") = objBIOS.SerialNumber
Next


it will set the computer name to the serial number found in the BIOS



Was this article helpful? Then please donate to keep The IT Community alive...

If you found this article helpful please share it, comment and help others by writing your own article.






Translate this page:




Articles found in the same category:
(max. 20 shown)