VBScript to name computers during OSD

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. 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. Enjoy!

GetComputerName.txt

Just rename to .vbs

Advertisement

One thought on “VBScript to name computers during OSD

  1. Hi, I do think this is an excellent web site. I stumbledupon it 😉 I may
    revisit once again since I saved as a favorite it. Money and freedom is
    the greatest way to change, may you be rich and continue to guide other
    people.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.