5/29/2020 Wds Computer Name Serial Number
Hello World,Today, again, we will speak a little bit about MDT 2012. The idea of this post came because of a discussion we had with one of our customers. This customer was not able to automate the deployment process because by default MDT generates a random computer name. The customer had first to rename the computer before joining it into the domain makin impossible for him to fully automate the deployment process.This post will quickly show you can use the CustomSettings.in (or equivalent rules GUI editor) to automatically set a computer name based on your naming convention. You will see that MDT 2012 can be tweaked in order to fit your situation.Let’s go!
![]()
Set computer Name using OSDComputerName variable Common ScenariosBy default, MDT 2012 allows you to define some rules in order to set the correct computer name during the deployment process. In order to set computer name during the deployment process, you can use the variable OSDComputername.
In order to define the rule that will be used to set the proper computer name, you have to understand the naming conventions used within your customer organization. In our situation, a naming convention was available (sweet) and the computer name to be generated would be the combination of a prefix text and the serial number of the machine. In other words, the computer naming convention was something likeWS-%SerialNumber%Based on this naming convention, it’s easy to automate the process with MDT 2012.
Open the Deployment workbench right-click on your deployment share and select properties.Click on picture for better resolutionIn the properties page, click on the rules tab. In this tab, add the following lineOSDComputerName=WS-%SerialNumber%Click on picture for better resolutionBy adding this line, you simply tell MDT to set the computername to the value you’ve just defined. Where MDT will find the%SerialNumber% value? Basically, MDT will run a series of scripts that will be performing wmi queries and store the results into variables.%SerialNumber% is one of the variable. MDT has more than 100 pre-defined variables that you can use.
You can see the list of available variables by running the script ZTIGather.wsf and by having a look at the file ZTIGather.xml. Both files are located under%DriveLetter%DeploymentShareScripts. You can use other variable as well such as.%Architecture% (ex: x86 or x64).%Model% (ex: Vaio xxxx or Inspiron.).%Make% (Dell,HP,Sony).%IsLaptop% or%IsDesktop% or%IsServer% or%IsVM% (to detect if the client is a laptop or a desktop or Server or a VM)Using multiple variables within the Customsettings.ini file (or the rules tab via the GUI), we can accommodate quite some situations. As an example, some organizations in their naming convention might require to make a distinction between desktop and laptop (or even server). Another common scenario is to make the distinction between virtual machine and physical machines.
If you encounter such situation, you can configure your rules as shown in the following screenshotClick on picture for better resolutionAnother common scenario for naming convention is to use a site code in the computer name. Depending on your network infrastructure and your MDT setup, you might be able to automatically set the name of the computer.
Jul 26, 2010 WDS and Windows 7 - Settings computername manually Sign in to follow this. If you leave the Computer Name node out of the Unattend file, it will prompt for Computer Name during OOBE. For example, you could put the computer name in the BIOS into the Asset Tag or Serial Number field, or you could do something like this: Quote; Share this.
For this one, I have to say that I had to google a little bit in order to find the variable that I could use. All the posts I’ve found are using the variable%DefaultGateway%So, if you need to make a distinction between two locations, you could edit your CustomSettings.ini file (see screenshot below) and append this kind of information as long as you are using default gateway information. In my case, we generally perform the deployment in a staging area where the default gateway is always the same whatever the location the computer will be send to.Click on picture for better resolution Advanced tweaks on OSDComputerName variableSo far, we have seen that there are a bunch of possibilities in the process of automatically set the computer name.
You can use variables, type of computers.whatever. Since, a lot of us are working with virtualization solution; there will be a situation were we will encounter a small issue when trying to automatically set the computername using the serial number variable.Indeed, there is a technical limitation in the number of characters you can use in a computer name. A computername cannot exceed 15 characters. Serial numbers generated by hypervisor are generally longer than 15 characters. I had the same issue (computer name length) with physical laptop.
Some manufacturer might have longer serial numbers than other. When combining the prefix and the serial number, the number of characters were exceding the limit of 15.You have two options to solve this issue. The first one is quite simple and consist of using again the Customsettings.ini files (or rules via the GUI).
![]()
Yes, you read it correctly, you can perform some string manipulation directly in the GUI. The other option would be to create your own script and perform the modification that you need in order to generate a valid computer name.In the screenshot below, I’ve defined a rule that would take the last 8 digit of the serial number.Click on picture for better resolutionYou can check that during the deployment process, the computer name will be generated based on the rule you have defined.Click on picture for better resolutionAs mentioned, the other option would be to use a script. In MDT 2012 Update 1, you should know that you can use PowerShell Script. Below, you can see a screenshot of a powershell script that perform a rename operation. In a future post, we will briefly describe how to have this script running within your MDT infrastucture.Click on picture for better resolution Final notesAs you can see, out-of-the-box, MDT 2012 offers you already a large set of options when you need to automate the computer name part of your deployment process.
By working with the MDT rules (the Customsettings.ini file), you can have a complete control of your deployment process. By tweaking this file, you should be able to achieve a zero touch installation using only MDT.In the coming posts, we will see how to use PowerShell script and we will finally focus on how to achieve the zero touch installationTill Next TimeSee ya Posted in Tagged, Post navigation. Hi there i was wondering if you could help. I am using mdt 2012 to deploy windows 7 –It’s all working fine, however i have two issues and i don’t know where to start.
1st is that I would like to pull the names from a database / file I know you can use MS SQL and setup an database and link it up with the task sequence in mdt 2012 essentially I want to pre-stage the computer names so when the pc are re-imaged they get the correct name.Secondly I want to move the imaged computers into to the correct OUI would appreciate if you ca help. Heloo Arjun,can you be more specific about what you want to do? I do not understand what you want to do. In the mdt task sequence, you can specify drivers to be installed, in MDT, you can automatically set the name of the computer based on different technics to meet your requirements. Yes, you can get MAC address automatically (using WMI during winpe phase of WINPE).How to you put all these together? What are you trying to achieve?Provide a more exhaustive scenario and we will see if we can help youtill next timeSee ya.
This is excatly what I needed. Thank you for this.
I do have a question with pulling only a certain number of characters in the serial number. We have MS Surfaces we are deploying. With our prefix we add to our computer names we can only pull 11 characters from the serial number. However we use the first 11 digits, not the last.Would be switching it to left instead of right do this?Would the line be OSDComputerName=Prefix-#left(“%SerialNumber%”,11)#??It seems to freeze my deployment before it starts when I use this. @Rangathis is a interestng questionand multiple ways.I do not know your setup but I would try to write a script that Query the Active Directory looking up for the prestaged account. Using a Unique identifer(mac address,guid,), when a match is found, the name found in AD can be setSame approach could be to use a web serviceAnother approach would be to export prestaged account + unique attribute and use this as input file in a script. If mac address found in the list, then set name to proper valueIf the MDT is join into the domain, you might be able to use the WDS functinoalites while running MDT.If I have time, I will have a look at itHope this helpTill next timeSee ya.
Im having some issues setting the computer name via mac address from the DB. It just wont set the name iv given.What am i doing wrong. I think its something in the CS. @Jonathan,Not sure what you are trying to achieve here. So if TS stands for Task Sequence and you are asking if you can use customSettings.ini only to have different computername, this might be possible. You have to modify the customsettings.ini file and set the TaskSequenceID in the Property rules (top of the file)Then you create 2 sections in Customsettings.ini you would end up with something like thisSettingsPriority=TaskSequenceID, DefaulttaskID1ComputerName=Fin-#######taskID1ComputerName=DB-#######You might need to perform some additional changes within the Task Sequence file but I think this should be the way to goHope this helpTill next timeSee ya.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |