Menu
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. Set computer Name using OSDComputerName variable Common Scenarios By 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 like WS-%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 resolution In the properties page, click on the rules tab.
In this tab, add the following line OSDComputerName=WS-%SerialNumber% Click on picture for better resolution By 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% DeploymentShare Scripts.
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 screenshot Click on picture for better resolution Another 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. 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 variable So 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.
Nero Company Name Serial Number
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 resolution You 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 resolution As 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 notes As 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 installation Till Next Time See 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 OU I 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 you till next time See 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. Simple function to get unique part of serial number. @Ranga this 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 set Same approach could be to use a web service Another 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 value If 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 it Hope this help Till next time See 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. @Walah, Technically this should be possible you would need to customize the the customSettings.ini file By default, MDT comes with pre-defined variable that you can then use within your customsettings.ini file You would need to define your variable in the Settings section ex MyLaptop,MyMake. You would need to create subsections MyLaptop and MyModel or MyMake and create variable that can be used to construct the name you want to use.
For example, if you want to identify a laptop, you would add something like this in your customsettings.ini file MyLaptop SubSection=Laptop-%IsLapTop% PCCategory=L and then in the same file, you would need to adapt your OSDComputername variable to concatenate your created variable something like OSDComputername=%PCCategory%-%PCSerialNumber% Hope this help Till next time See ya As currently, we do not have much time to create a post about that We are really overloaded by work. Hope this help Till next time.
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 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. Kodomo no omocha sub ita ep 1.
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. 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.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |