Thursday 27 June 2013

How to set the Computer Name to a the Serial Number during OSD SCCM 2012 SP1

Hello,

Its 11:30pm on a Thursday, I was falling asleep but I shot out of bed in the realization that I have wanted to post this for a while now, so I just got up and did it!

Scenario
Lets assume you have a bunch of PC's and you want to come up with a naming solution to automatically re-name them as part of the OSD, the serial number is a good idea and its almost guaranteed to be unique, right? Correct. Now some people will advise that you run a script or use WSNAME amongst other solutions, and these solutions do work, but I have recommend this much simpler solution instead for SCCM 2012 SP1.

My client had a requirement that the company's acronym formed the formed the first part of the PC name, followed by a number.

For example, AAAA1234

Now I will assume that you have SCCM 2012 SP1 installed with MDT and you have configured Config Manager integration, if you don't fear not, I have document the entire process here (http://heinrichandsccm.blogspot.co.uk/2013/04/how-to-setup-and-configure-sccm-2012.html)

This is how its done
First we need to edit the task sequence, so you need to add 3steps the first is the "Use MDT Package" step just after your "Apply OS" step



The next step is "Gather" and ensure you set it to "Gather only local data (do not process rules)"

The third step is the "Set Computer Name" step this is done by adding a "Set Task Sequence Variable" this can done by clicking "Add" from the menu above your task sequence and looking for the "Set Task Sequence Variable" option. You can now rename this to Set Computer Name for example.

Make sure you have the following in place as shown below, you will need the sequence variable to set to OSDComputerName. The value can then be set to %SERIALNUMBER%



Once saved you can then alter this slightly to AAAA%SERIALNUMBER% this will then change the Computer Name to AAAA123456 if "123456" was the serial number.

One last important note please make sure you test this before mass roll out, and also that you make 100% sure that you have added these steps after Apply OS and before the Apply Windows Settings step.

Enjoy
 





1 comment:

  1. To get computer name and other input variables use SCCM Task Sequence OS Deployment Orchestrator. It's free and enterprise grade. www.sccmtspsi.com
    A Just to mention a few benefits:
    - Detailed email reporting of task sequence deployments.
    - Unlock Bitlocker (Active Directory, remote Active Directory, MBAM, file & key)
    - OnDemand task sequence selection.
    - Operating system selection
    - Office application selection.
    - SCCM application selection.
    - SCCM collection membership in real-time.
    - Active directory group membership.
    - Add Primary system users.
    - Save and restore user data (USMT).
    - 18 extension attribute assignments.
    - Automatic staging.
    - Decommissioning.
    Documentation : https://sccmtspsi.com/documentation/

    ReplyDelete