Renaming a computer name to the serial number. Run some code to get the serial number before launching Setup, and insert the desired computer name directly into.
How To Get Computer Name From Ip Address
Determining a computer name during an imaging process has always proved to be a challenge. One of my favorite methods is to utilize WMI to obtain the serial number of the computer that is being imaged.
Computer Name Windows 10
This way, if all your hardware is from a particular vendor, Dell, HP, Panasonic, you can guarantee that no two computer names will ever be the same and you can name them automatically during the imaging process. Not to mention you can quickly look up the computer information on the vendor website. The following vbscript I wrote will determine the serial number, append a “C” to the front of it, then populate the OSD task sequence variable called “OSDComputerName”. It is one of the first tasks in all my task sequences. One of the extras I wrote in will actually prompt you to enter the computer name if it detects it is a VMware, Citrix or Microsoft Virtual machine, because they do not have a serial number in WMI. Just rename to.vbs.
The syntax is the same for VB6 (execept for the Wscript.Echo) strComputer = '.' Set objWMIService = GetObject('winmgmts: ' & strComputer & ' root CIMV2') Set colItems = objWMIService.ExecQuery( 'SELECT. FROM Win32ComputerSystemProduc t',48) For Each objItem in colItems Wscript.Echo '- - ' Wscript.Echo 'Win32ComputerSystemProdu ct instance' Wscript.Echo '- - ' Wscript.Echo 'Caption: ' & objItem.Caption Wscript.Echo 'IdentifyingNumber: ' & objItem.IdentifyingNumber Wscript.Echo 'Name: ' & objItem.Name Next.