Jump to content


slater7607

Setting Computer Description during OSD

Recommended Posts

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

  • Like 1

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...