Wds Computer Name Serial Number
I have been given the responsibility to deploy about 100 computers in an environment and needed to assign different computer names to each machine. Currently I have a setup using MDT for the actual deployment and WDS that is used for the PXE boot.
A couple weeks ago I got a question from a norwegian fellow. They prestage all computers in Active Directory based on their UUID and he wanted to be able to query AD to get the computer name for their Deployments.
The UUID of a computer can be stored in the Active Directory property netbootGuid. This property is e.g. also used by the RIS Deployment process. During a RIS Deployment it would be able to find an already existing computer object based on this property or create a new computer account with this property (WDS doesn’t use this property anymore). And I actually like the idea of being able to uniquely identify a computer without the need for another database.
So even if not used that often these days I thought it might be worth to enable the webservice to handle GUID values in Active Directory. As this is not as easy as it sounds 😉
What is a UUID?
A UUID (Universally Unique IDentifier) or GUID (Globally Unique IDentifier) is generally a 16-byte number typically written as a sequence of hexadecimal digits like {4C4C4544-0038-5310-804B-C4C04F31344A}. It should, as the name implies, be unique. Sometimes the GUID is derived from some other values like Serial Number or MAC Address which could result in repetition but generally treat it as unique. The UUID of a computer is stored in the BIOS and can be read via WMI (e.g. use “wmic csproduct get uuid” to see the UUID of your computer).
UUID/GUID and the Active Directory
Active Directory is also using GUIDs for unique identification. Each object in Active Directory does have an objectGUIDattribute. As said already, computer objects can also have an attribute netbootGuidwhich can store a UUID. But working with the UUIDs in Active Directory raises two problems:
- UUIDs are stored as an array of bytes
To store a UUID in AD you would need to convert each pair of hexadecimal digits into the decimal value e.g. 4C=76 , 4C=76 , 45=69 , 44=68 …. and add each to an array. To get the value you need to do this the other way round and convert each byte into the hexadecimal value and concatenate it.
- UUIDs are stored in a different order than displayed
I skip the part about little-endian and big-endian on Intel based systems (see Wikipedia – Endianness). As the most important thing for you to know is, that the bytes stored in AD are a little bit “mixed up”. It will swap the byte order of the first three parts separated by the dash. Let me show you this on the example from above.4C4C4544-0038-5310-804B-C4C04F31344A
would become
44454C4C-3800-1053-804B-C4C04F31344A

Finding a computer based on the UUID
Taking everything together we heard so far we now can search for a computer using tools like AdFind, dsquery or a custom script using ADSI. The necessary query string to find the computer with a netbootGUID from the example would look like
Aug 19, 2014 - 49 min - Uploaded by pakiyo oyeVideo yang sangat mendidik untuk menemani anak-anak indonesia dalam bermain. Download free Teletubbies Bahasa Indonesia Youtube Video on many video type quality 3gp Mp4 Flv Webm 2D 3D SD HD through online using your Mobile Phone Smart Phone, Android, Iphone, Symbian, Java or PC - Waplic.Com. Teletubbies actors,teletubbies again again,teletubbies all fall down,teletubbies all together teletubbies,teletubbies allahu akbar,teletubbies amy's pasta,te. Aug 25, 2017 - 11 minDownload free Teletubbies bahasa indonesia Saatnya bekerja Time to work Youtube. Teletubbies videos. Teletubbies Bahasa Indonesia SAATNYA BEKERJA (Time to Work) by pakiyo oye. Teletubbies Bermain Dengan Lumpur Bahasa Indones, Teletubbies: Bermain Dengan Lumpur ( Bahasa Indonesia ) by RAJAGODA Download. Teletubbies Oooh Bahasa Indonesia, Teletubbies Oooh! Bahasa Indonesia.
(&(objectClass=computer)(netbootGuid=44454C4C38001053804BC4C04F31344A))
That’s almost self-explanatory, isn’t it? 😉
If you are using the .Net Framework (e.g. with Powershell) your life get’s a lot easier as with Version 3 of the .Net Framework it has built-in support for this conversion. Each System.GUID object now has a function called “ToByteArray()” which will not only convert each hex-value into a byte, it will also re-order the GUID appropriately.
The easier way
Sure, all this can be scripted (and a lot of people have done this already. You will find a lot of published scripts for this on the internet) but I would prefer to be able to call a webservice during my Deployment and let it return the Computername if it exists already. And I really don’t want to deal with all this stuff described before. So as said already in the last post, the Deployment webservice has been just updated to Version 6 (Find the Download on CodePlex) which now supports a wide variety of properties to work with. And it is now also capable of handling such UUIDs. So all you now need to do is getting the UUID from the BIOS (actually MDT will do this for you during the gather step and store it in the property “UUID”) and then call the webservice function GetComputerNameByNetbootGuid supplying the UUID. The result will be the computername if known or an empty string if not known. To do this, add the following section to your customsettings.ini
Comments are closed.