Domain Name Format is Invalid

This topic contains 4 replies, has 3 voices, and was last updated by  Don Jones 2 years, 2 months ago.

  • Author
    Posts
  • #27531

    Josh Sutton
    Participant

    I have been assigned to a project to integrate another facility's computers into our domain. I'm trying to script the domain join process but I keep receiving an error indicating the format of the specified domain name is invalid. If I go through the GUI it accepts the domain name just fine and everything is right as rain. The code I'm attempting to us is as follows:

    $OSFCred=Get-Credential
    Add-Computer -DomainName Intranet.osfnet.org -Credential $OSFCred -Passthru

    I've surfed around a bit and a few sites suggested it could be a DNS issue, and that the primary DNS had to be pointing to the DC for the domain I wish to join, but making that change had no impact on resolving the error even after clearing the local dns cache.

    Please advise?

  • #27533

    Rob Simmers
    Participant

    Does it work if you use the short name (Intranet) versus the FQDN? It might just be how the cmdlet is resolving the domain.

  • #27534

    Josh Sutton
    Participant

    It does not. If I replace the fqdn with "intranet" I get an error indicating the domain controller for the specified domain name could not be reached

  • #27535

    Don Jones
    Keymaster

    It's definitely name resolution. I wouldn't say changing the DNS, necessarily, but make sure the existing DNS server knows how to reach the other domain's DCs. When you use the GUI, a whole different set of protocols can end up getting involved – it does more under the hood work for you. An alternate would be to temporarily, via script, hack the hosts file on the machine so it can find the remote domain. Or hack lmhosts so it can find the domain by its NetBIOS (short) name.

  • #27536

    Don Jones
    Keymaster

    Or, alternately, use Netdom.exe instead of Add-Computer.

You must be logged in to reply to this topic.