PS 2.0 Join Domain

Welcome Forums General PowerShell Q&A PS 2.0 Join Domain

This topic contains 1 reply, has 1 voice, and was last updated by

1 year, 11 months ago.

  • Author
  • #68161

    Points: 0
    Rank: Member

    I'm trying to add a computer to the domain via PS 2.0 but everytime I run the script I get

    Add-Computer : This command cannot be executed on target computer ('ComputerName') due to following error: The parameter is incorrect.
    At C:\......
    * Add-Computer < <<< -DomainName domain.local -Cred $cre -Unsecure * CategoryInfo : InvalidOperations: (ComputerName:String) [Add-Computer], InvalidOperationException * FullyQualifiedErrorId : InvalidOperationsException.Microsoft.PowerShell.Commands.AddComputerCommand HEre is the script I have

    #Gather Computer Type
    $floorou = Read-Host 'What floor will the user be in:'
    $ComputerOU = 'ou='+$floorou+',ou=Computers,ou=city,dc=domain,dc=local'

    #Gather Info
    $Username = Read-Host 'Employee Username'

    # get the credential
    $cred = get-credential

    # enter the computer in the right place

    Add-Computer -DomainName domain.local -Credential $cred -OUPath $ComputerOU -Unsecure

  • #68172

    Points: 0
    Rank: Member

    Using -Unsecure on the Add-Computer was causing the issue

The topic ‘PS 2.0 Join Domain’ is closed to new replies.

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