Add-Computer Authentication Method

Welcome Forums General PowerShell Q&A Add-Computer Authentication Method

Viewing 3 reply threads
  • Author
    Posts
    • #266570
      Participant
      Topics: 12
      Replies: 25
      Points: 31
      Rank: Member

      All,

      I am in the process of creating a script to migrate our workstations from our legacy domain to the our new domain.  I can disjoin the legacy domain but I am having issues joining the new domain.

      Here is what I am using

      $joincred = New-Object pscredential -ArgumentList ([pscustomobject]@{

      Username = ‘Username’

      Password = (ConvertTo-SecureString -String ‘password’ -AsPlainText -Force)[0]

      })

      Add-Computer -DomainName ‘Name’ -Credential $joincred

      The issue arising from this is, “corporate” and their infinite wisdom, has completely blocked NTLM authentication, which is what the above is trying to use.  Is there a way I can force the use of Kerberos with this command or is there a different method of doing this.  I am wanting this to be as automated as possible.

    • #266579
      Participant
      Topics: 1
      Replies: 55
      Points: 523
      Helping Hand
      Rank: Major Contributor

      Hello Joseph,

      One of the options would be to Add a computer to a domain using predefined computer credentials

      which is not yet domain-joined: $joinCred = New-Object pscredential -ArgumentList ([pscustomobject]@{ UserName = $null Password = (ConvertTo-SecureString -String 'TempJoinPA$$' -AsPlainText -Force)[0] }) Add-Computer -Domain "Domain03" -Options UnsecuredJoin,PasswordPass -Credential $joinCred[/crayon]

      Reference: Add-Computer Documentation

      Hope that helps.

      • This reply was modified 1 month ago by AndySvints.
    • #266585
      Participant
      Topics: 16
      Replies: 1855
      Points: 3,568
      Helping Hand
      Rank: Community Hero

      This is being executed on a non-joined domain computer? How is the user name formed? Domain\User or [email protected]. Are you getting a error?

    • #266717
      Participant
      Topics: 12
      Replies: 25
      Points: 31
      Rank: Member

      This worked.  I was unsure about this process when I originally read it.  This will cause some more pre-work before I run the full script, but that is ok.

      Hello Joseph,

      One of the options would be to Add a computer to a domain using predefined computer credentials