Question for all the Active Directory programmer nerds out there: If you have the distinguished name for a computer in AD and you need to resolve that to the computers fully-qualified host name, what's the best way to do that?
You might be tempted to say, "Duh, just read the dNSHostName property." but I have found that out in the wild, there are many computers that do not have this property set, so I'm trying to not make any assumptions about properties might be present.
I'm thinking that one of the following might be the best way, but I don't know which one (thread):