wds pc name based on previous ad pc name

we have an ad wich has computers named WS1234 all the way up to WS1801.(this was done by hand with the person that worked here before me)We now get 50 more pc's.

I have an wds image with an autounattend file.what I want to do now is set in wds that it auto joins the domain but i need a way that it looks at the previous pc name and then add one so the first name that needs to be done is WS1802. withouth pre defining all the computers

Can somebody help me do that?


I had to solve this exact problem about 7 years ago and wrote a blog post about it

You need to populate the NetbootGUID attribute of the computer object in Active Directory with either the unique GUID of the NIC in the device, or the device's MAC address with leading 0's. I wrote a powershell script to run through a CSV formatted list and pull the MAC addresses from remote computers and populate it in AD - it's provided in that link.

Please keep in mind that the script is 7 years old - none of this should have changed, but test first before running in production.


Now as an aside - there are better ways to do this than just vanilla WDS. If you haven't looked at the Microsoft Deployment Toolkit, you should. It's much more capable than standalone WDS and manually generating an answer file.