Techs in the field are deploying windows 7 pcs onto a domain. They complete one entry screen, which should give them a unique computer name. However, they are human and end up giving the pcs the same name. The pcs are connected by TCP/IP to a router at the site.

I'd like to detect the duplicate names before the pcs attempt to join the domain. However, from the testing I've done using ping, arp, nbtstat, System.Net.Dns.GetHostEntry, shows that information is dependent on reboot timing.

Test point A
Rename the computer
Test point B
Join the domain
Test point C

The actual reboots can take several minutes. I understand that detecting a pc that is rebooting will not work, but I can't even detect this at "Test point B" with both machines on.

Actually, if both machines stop at "Test point B", the last to reboot can not detect the other. The first to reboot can see the other.

  • 1
    Have you considered publicly flogging the technicians who screw up and don't use the auto-generated unique name? – voretaq7 Jun 21 '13 at 16:58
  • 1
    Not the solution you are looking for, but a good naming scheme would likely be much more effective than any technical solution is going to be. Ultimately it is an operational problem for which a technical solution is sought. This may mean naming machines based on their location (still runs the risk of clashes) or using an ever increasing sequence of numbers which are never re-used (perhaps from a unique asset tag?). If you name machines by location, you also need a strict policy to ensure they are renamed whenever moved - the asset tag solution avoids this and is location independent. – Cosmic Ossifrage Jun 21 '13 at 17:01

As far as I'm aware the answer is "No" -- You cannot detect duplicate names until you attempt to join the domain, because you do not have access to the list of domain computers until you attempt to join the domain.

You could theoretically download the list of domain computers from AD and check against that offline (prior to joining the domain), but that information would be obsolete as soon as you obtained it, and would be out of sync with the reality of what your domain machines are named.

As tigermatt noted a good naming scheme can help here (as long as everyone sticks to it).

  • The naming scheme is appropriate. Easy to understand, unique across the organization, and yet they get it wrong. Thanks for the sanity check. – dfrevert Jun 21 '13 at 17:07
  • 2
    @dfrevert ...I refer you to my earlier suggestion of "public flogging" :-) – voretaq7 Jun 21 '13 at 17:27
  • "public flogging" is enticing, but not appropriate for minimum wage lackeys that aren't using their native language and got to work at 6am to finish before 8. The "public flogging" should be applied to those documenting the process that decided to rename Client/Server as Register/Terminal which doesn't even map 1 to 1. But this is not the place for that . . . – dfrevert Jun 21 '13 at 17:59

They're only allowed to join the domain with a colliding name is because they have control over the computer accounts of the existing systems - their domain user accounts are able to 'steal' the existing domain account of the existing computer with that name, while a domain join would normally be creating a new computer account.

Take away their rights to modify the existing computer accounts. The domain joins should start failing, hopefully providing adequate feedback to get them to realize their mistake (not sure off the top of my head what the exact error message is, though).

  • Interesting suggestion. It would require restructuring domain permissions in a very granular way. That might be very difficult to do in an existing environment, but it something to consider when setting up a new domain or doing a migration to a new one. Of course: It depends of company policies (and politics) whether or not you would be allowed to do something like this. – Tonny Jun 22 '13 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.