Skip to content

Setting Computer Description during OSD

Featured Replies

I had a request from a previous post to share how we are changing the computer description during OSD. We currently use this to have our techs enter in the location of the computer to help with automating our inventory. Also, if anyone has a better way of doing this please feel free to contribute.

 

Also, in our environment the description does not filter back to AD it only remains local to the machine but YMMV as I haven't looked too far into that. The description still filters back in through a custom report so it achieves everything that we need it to.

 

1. Create a computer description TS variable

FNeBP.jpg

 

2. Include the following script as part of one your packages and execute it sometime before your OS install (we include all of our scripts in the MDT Toolkit package)

J9Kkx.jpg

 

TSComputerDescPrompt.vbs

Dim oTaskSequence, strComputerDesc
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
' The wscript.echo commands are logged in SMSTS.log for troubleshooting.
' They are not displayed to the end user.
sComputerDesc = InputBox ("Enter desired computer description." &VbCrLf & VbCrLf & "X Domain - Computer location example: BUILDING ROOM #" &VbCrLf &VbCrLf & "Domain - Tag Number example: 10-0454 or 106183","Computer Description",,,30)
oTaskSequence("OSDComputerDesc") = sComputerDesc
wscript.echo "Set Task Sequence variable OSDComputerDesc to: " & strComputerDesc

 

 

3. Execute this final script with another task sometime after the OS install, we do it right after.

uc88f.jpg

 

TSComputerDesc.vbs

Dim objShell
Dim oTaskSequence, strComputerDesc
Set objShell = WScript.CreateObject ("WScript.shell")
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
' The wscript.echo commands are logged in SMSTS.log for troubleshooting.
' They are not displayed to the end user.
strComputerDesc = oTaskSequence("OSDComputerDesc")
objShell.run "reg add HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters /v srvcomment /d " & strComputerDesc & " /f"
wscript.echo "Computer Description changed to: " & strComputerDesc

  • 1 year later...

hi,

i am not good in the scripting. i am using sccm2012 SP1 integrated with MDT2012. I want to set computer description during OSD. I had created a collection veriable named "OSDaComputerDesc" for the cllection of unkonown computer. i was think it should work as like as "OSDComputerName". i could able to set the computer name with the help of this collection veriable. for computer description i get the promt to enter the value but when i cheked the comkputer properties after the os deployment i couldn not see any value in the Computer Description.i have below question.

1. how can i create those VB scripts (TSComputerDescPrompt.vbs & TSComputerDesc.vbs)? can i just copy the content which u have given and paste in a txt fiale save it as a .vbs?

2.how those can be added in the MDT Toolkit package? In which folder is hould keep those scripts so that TS can pull those.

 

could you please help me out as i need set this valu for the inventory purpose?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.