Geez, im a roll with all these asking Questions!!!
Heres my latest.
Ive written a vbs script to pull out the bios make and serial number as thats the naming convention here.
So basically
Grabs Make and Serial
Strips make down to 4 chars
Combines the two
Asks the user is this ok?
If its ok .. continue on
If its not .. get them to input
Now .. the script works great, but when i whack it in the TS and get it to run, the input dialog boxis hidden behind the TS (Installation Progress) window. Seems the TS window is set to Always on Top or something like that
I tried to hide this window just for that task by
Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
ProgressUI.CloseProgressDialog
No good.
Heres my script, any thoughts on how I can achieve this? It would be great just to hide that window for that specific task so the user can do this.
----------------
Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
ProgressUI.CloseProgressDialog
Dim objWMI : Set objWMI = GetObject("winmgmts:")
Dim colSettingsComp : Set colSettingsComp = objWMI.ExecQuery("Select * from Win32_ComputerSystem")
Dim colSettingsBios : Set colSettingsBios = objWMI.ExecQuery("Select * from Win32_BIOS")
Dim objComputer, strModel, strSerial, strComputerName
For each objComputer in colSettingsComp
strModel = objComputer.Model
Next
For Each objComputer in colSettingsBios
strSerial = objComputer.SerialNumber
Next
strComputerName = Left(strModel,4) & strSerial
If MsgBox ("Is this computername Correct? " & strComputername, vbYesNo) = vbNo then
strComputerName = InputBox("Please correct the computer name" & (Chr(13) & Chr(10)) & (Chr(13) & Chr(10)) & "The computer name is the first 4 numbers of the model and serial number combined","Confirmation Required",strComputerName)
if strComputerName = "" then strComputerName = Left(strModel,4) & strSerial
End If
'MsgBox ("This is the computer name being set " & strComputername)
set env = CreateObject("Microsoft.SMS.TSEnvironment")
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.
Geez, im a roll with all these asking Questions!!!
Heres my latest.
Ive written a vbs script to pull out the bios make and serial number as thats the naming convention here.
So basically
Grabs Make and Serial
Strips make down to 4 chars
Combines the two
Asks the user is this ok?
If its ok .. continue on
If its not .. get them to input
Now .. the script works great, but when i whack it in the TS and get it to run, the input dialog boxis hidden behind the TS (Installation Progress) window. Seems the TS window is set to Always on Top or something like that
I tried to hide this window just for that task by
Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
ProgressUI.CloseProgressDialog
No good.
Heres my script, any thoughts on how I can achieve this? It would be great just to hide that window for that specific task so the user can do this.
----------------
Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
ProgressUI.CloseProgressDialog
Dim objWMI : Set objWMI = GetObject("winmgmts:")
Dim colSettingsComp : Set colSettingsComp = objWMI.ExecQuery("Select * from Win32_ComputerSystem")
Dim colSettingsBios : Set colSettingsBios = objWMI.ExecQuery("Select * from Win32_BIOS")
Dim objComputer, strModel, strSerial, strComputerName
For each objComputer in colSettingsComp
strModel = objComputer.Model
Next
For Each objComputer in colSettingsBios
strSerial = objComputer.SerialNumber
Next
strComputerName = Left(strModel,4) & strSerial
If MsgBox ("Is this computername Correct? " & strComputername, vbYesNo) = vbNo then
strComputerName = InputBox("Please correct the computer name" & (Chr(13) & Chr(10)) & (Chr(13) & Chr(10)) & "The computer name is the first 4 numbers of the model and serial number combined","Confirmation Required",strComputerName)
if strComputerName = "" then strComputerName = Left(strModel,4) & strSerial
End If
'MsgBox ("This is the computer name being set " & strComputername)
set env = CreateObject("Microsoft.SMS.TSEnvironment")
env("OSDComputerName") = strComputerName
Share this post
Link to post
Share on other sites