SCCM – Setting Computer Name automatically during OSD Process [2020 Updated]

microsoft black logo

We have been looking into getting our OSD process to automatically change the computer name to what we want it to be for a while now but never really had much luck with it.

Reading various forums and blogs, many people have said to use WSNAME and many others saying use scripts, all of which never seemed to quite work for us.

What we wanted was a three letter prefix with the serial/tag number of our machines. Most of our machines (99%) are Dell’s and we wanted to use the 7 digit asset tag with a 3 letter prefix but things like the WSNAME only seemed to work with our HP’s using the %SERIALNUM% variable. Using this method, all our Dell machines were reporting the %SERIALNUM% as blank, so instead of:

ABC6TQX8X1

It came out as just:

ABC

Not really much use!

So, we decided that we really needed to spend some time on this and get it working once and for all. After actually dedicating some time to it instead of just messing about with it for five minutes here and there, we finally got it working.

For those of you that know MDT, we used this with a mixture of Gather and Set Task Sequence Variable. Tested it, works a treat!

So, a quick how to guide for those wanting to know how to do it as we have really struggled to find a simple step by step guide to doing such a simple task.

Prerequisites

We do assume that you have a good understanding of both MDT and SCCM at this point. You also need to have MDT installed and integrated into SCCM. If you need to create the MDT package, please read the next section, if not, jump to the instructions section.

MDT Package Creation

The easiest way to create the MDT package is after you have integrated MDT into your SCCM. Go ahead and right click on your Task Sequences and select Create MDT Task Sequence.

SCCM Task Sequence

Run through the wizard and just create any old task sequence – you can delete the task sequence after. Part of creating the MDT task sequence is to create the MDT package if you have not already done so. Once complete, the MDT package then needs to be deployed and you should then be able to use it within your other task sequences.

Instructions

First of all, you need to have MDT installed. You also need to make sure that you have ConfigMgr integration working, please note that this guide does assume that you have MDT fully up and running to use in your Task Sequences within ConfigMgr….if you need to know how to get this to work, leave a comment at the bottom of this post and we will look at getting a guide uploaded for doing that….

Edit your selected Task Sequence and just after the Deploy OS step, add your Use MDT Package step:

SCCM Task Sequence

Then, directly after this step, add the Gather step and set it to Gather only local data (do not process rules)

SCCM Task Sequence

Then, the final bit which applies the computer name, add Set Task Sequence Variable then make sure that the Task Sequence Variable is set to OSDComputerName. The value can be whatever you want it to be, the standard is:

%SERIALNUMBER%

SCCM Task Sequence

This will set the computer name as the, you guessed it, Serial Number.

If you want to customise it slightly, just add the text before the %SERIALNUMBER%, so as an example:

ABC%SERIALNUMBER%

SCCM Task Sequence

Save your task sequence and it should work.

Few things to remember that are very important, this part must be added AFTER the Deploy OS step, but also BEFORE the Apply Windows Settings step.

Feedback

We would love to hear your feedback on this article so come and join us on Facebook or Twitter and let us know what you think!

SCCM Task Sequence failed due to package associated to the task sequence cannot be found

sccm logo

If you get an issue when trying to load a task sequence and you get the message that a package associated to the task sequence cannot be found, even when it looks like all packages are fully distributed, then you need to check out the SMSTSLog.log file that is on the machine that you are trying to deploy the task sequence to.

To do this, you must have the command prompt via F8 turned on.

Go into a command prompt by pressing F8 and then go in the root of your X: drive. From here type:

  • Cd %temp% and press enter
  • Then go into the SMSTSLog folder by typing;
  • Cd SMSTSLog and press enter

You can then see the SMSTSLog.log file, however, you want to be able to open it up in trace32.exe so that you can view the errors. For me, the best way is to map a network drive to a share, then copy the file to that share on then open an another machine that has trace32.exe installed, from here, you should be able to find the package ID that has the problem, update the distribution of this package and then your task sequence should run without issues.

Shoretel Contact Center – Agent stuck in Release mode

Shoretel Orange and Black Logo

We had an issue this week with one of our Shoretel Contact Center Agents being stuck in Release mode. When trying to Resume, the agent was getting the following error:

Your extension has lost its connection to the telephone system

We tried everything to get this working, including removing the software completely from the agents machine and reinstalling, but still nothing, so as a very last resort, we rebooted the Contact Center main server, as soon as it came back up, everything worked!

So, maybe not a solution for this issue, but it has certainly got the agent working now….we’ll be looking into why this happened next week so if we find a solution I’ll post it on here.

Orchestrator Runbook for Email Notification for ConfigMgr Software Catalog Requests [2020 Updated]

SCORCH Logo

I’ve had a number of requests about how I created our email notification for requests for software made via our ConfigMgr software catalog. The solution is very simple and very basic, but until I get our Service Manager up and running (which does the job much better..), this is working for us so hopefully will … Read more

SCCM Capture media in Windows x64 not working – FIX

sccm logo

We came across an issue today where the capture media (ISO) that we use to capture our newly created images would not load when running the TSMBAUTORUN.exe file from an explorer box.

This was even more strange as it works fine for x86 versions of Windows.

After some digging around, its to do with the autorun feature in x64 being off by default and working directories….anyway, to cut a long story short, the fix it very simple…

Go into a CMD box and go to the drive where your capture is located (ours is a CD so drive letter D: )

Then, do not go into this folder location, it must be run from the root of the drive, type the following command:

smsb\ini\386\tsmbautorun.exe

Hit enter and it should run….