I was looking for someone that has good VB scripting backgound that could give me a hand. Our enterprise is pretty much an all Dell shop, and our techs name the machines with the Dell service tag mainly for asset tracking. Now, I setup a Task Sequence for OSD and advertised it to the "All Unknown Computers" collection for all bare metal machines. Now I have a working script that I added into the TS that will bring up a pop-up box asking for the machine name (i know you can set this as a variable in the collection, but i like the script better), here is the script i am using for that:
Dim sNewComputerName, oTaskSequence, sTSMachineName
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
' Get the name the computer is set to receive and truncate to first 6 letters
wscript.echo "Set Task Sequence variable OSDComputerName to: " & sNewComputerName
Else
wscript.echo "Computer set to receive a standard name, continuing as is."
End If
NOW, rather than having the script ask for a computer name and have the tech enter the asset/service Tag off the Dell, i would like to have a script like the one above, but rather than asking to enter the computer name, i would like to query the BIOS for the Dell asset tag and automatically use the results as the OSDComputerName. I have the VBS that gets the information i need from the BIOS but i can't for some reason get it to work with the TS, keeps erroring out of me. I tried to take peices from the ove script and added some lines from the below script with no luck. If anyone has a script or knows how to create one with what i have let me know. Thanks for the help/
DELL BIOS VBS
Set objWMIservice = GetObject("winmgmts:\\.\root\cimv2")
set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48)
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Hello,
I was looking for someone that has good VB scripting backgound that could give me a hand. Our enterprise is pretty much an all Dell shop, and our techs name the machines with the Dell service tag mainly for asset tracking. Now, I setup a Task Sequence for OSD and advertised it to the "All Unknown Computers" collection for all bare metal machines. Now I have a working script that I added into the TS that will bring up a pop-up box asking for the machine name (i know you can set this as a variable in the collection, but i like the script better), here is the script i am using for that:
Dim sNewComputerName, oTaskSequence, sTSMachineName
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
' Get the name the computer is set to receive and truncate to first 6 letters
sTSMachineName = oTAskSequence("_SMSTSMachineName")
sTSMachineName = lcase(left(sTSMachineName,6))
If sTSMachineName = "minint" Then
' The wscript.echo commands are logged in SMSTS.log for troubleshooting.
' They are not displayed to the end user.
wscript.echo "Detected that the computer name is scheduled to receive a random value. Prompting user to input a standard name."
sNewComputerName = InputBox ("Please enter a standard computer name.", "Computer Name", , 30,30)
oTaskSequence("OSDComputerName") = sNewComputerName
wscript.echo "Set Task Sequence variable OSDComputerName to: " & sNewComputerName
Else
wscript.echo "Computer set to receive a standard name, continuing as is."
End If
NOW, rather than having the script ask for a computer name and have the tech enter the asset/service Tag off the Dell, i would like to have a script like the one above, but rather than asking to enter the computer name, i would like to query the BIOS for the Dell asset tag and automatically use the results as the OSDComputerName. I have the VBS that gets the information i need from the BIOS but i can't for some reason get it to work with the TS, keeps erroring out of me. I tried to take peices from the ove script and added some lines from the below script with no luck. If anyone has a script or knows how to create one with what i have let me know. Thanks for the help/
DELL BIOS VBS
Set objWMIservice = GetObject("winmgmts:\\.\root\cimv2")
set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48)
For each objitem in colitems
Wscript.echo objitem.serialnumber
Next
Share this post
Link to post
Share on other sites