Domain Name Format is Invalid

Welcome Forums General PowerShell Q&A Domain Name Format is Invalid

This topic contains 4 replies, has 3 voices, and was last updated by

 
Keymaster
3 years, 7 months ago.

  • Author
    Posts
  • #27531

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 527
    Helping Hand
    Rank: Major Contributor

    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

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    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

    Keymaster
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

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

The topic ‘Domain Name Format is Invalid’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort