The company I work for uses almost exclusively Dell computers which have service tags as serial numbers. We have been incorporating the service tags into our computer names since I started here in 2011. We have gotten big enough to where I am working on an automated deployment solution so that we don't have to touch every system that we deploy.
What I am hoping to accomplish is to enable the system to automatically create a computer name that includes Dell's Service tag. We use the naming convention COMPUTERTYPE-LOCATION-SERVICETAG (for example, DST-VA-HJ631R1) for a desktop in Virginia with a Dell service tag of HJ631R1. I know that the service tag can be pulled from the BIOS using the command:
wmic bios get serialnumber
However, I have no idea how to take that information and put it into a txt file or something that I could point Sysprep to use for the system name. Could anyone assist in explaining how I could make this happen, preferably with code?
Thanks in advance, and feel free to ask for more information!