Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Trying to use Add-Computer -ComputerName (Get-Content Computers.txt)

$
0
0

I've been trying to test out joining computers to a domain using the command below.  My reference for this is from Microsoft, here.   

Add-Computer -ComputerName (Get-Content Computers.txt) -Domain IMG.local -Credential IMG\Administrator -Options Win9xUpgrade -Restart

I have "Computers.txt" created with one test computer in it.  This text file is located in the same folder where the script is.  

Below is my error when running.  Any suggestions?

Add-Computer : A parameter cannot be found that matches parameter name 'ComputerName'.
At \\imaging\d$\Support\Domain Migration\Join_Domain.ps1:1 char:27+ Add-Computer -ComputerName <<<<  (Get-Content Computers.txt) -Domain IMG.local -Credential IMG\Administra
tor -Options Win9xUpgrade -Restart+ CategoryInfo          : InvalidArgument: (:) [Add-Computer], ParameterBindingException+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.AddComputerCommand


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>