Ashar Kallumpurathu
asked on
adding computers to a domain using command line
I want a command to add computers to my Windows Active directory domain
one computer or a list of PCs?
Add-Computer -DomainName yourdomain -Restart
run it from the PC which you want to add it to the domain
for more info. see https://technet.microsoft.com/en-us/library/hh849798.aspx
ASKER
Will you Show me an example
suppose you want to add the PC named testpc to your domain named lab.com
logon to testpc, open the powershell as administrator, type: Add-Computer -DomainName lab.com -Restart
the pc is added to the domain and will restart automatically, is it clear?
logon to testpc, open the powershell as administrator, type: Add-Computer -DomainName lab.com -Restart
the pc is added to the domain and will restart automatically, is it clear?
ASKER
its showing the following errors when typing this command
Add-Computer : A parameter cannot be found that matches parameter name 'Restart'.
At line:1 char:46
+ Add-Computer -DomainName Dascase.com -Restart <<<<
+ CategoryInfo : InvalidArgument: (:) [Add-Computer], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Mic rosoft.Pow erShell.Co mmands.Add ComputerCo mmand
how to resolve this error
Add-Computer : A parameter cannot be found that matches parameter name 'Restart'.
At line:1 char:46
+ Add-Computer -DomainName Dascase.com -Restart <<<<
+ CategoryInfo : InvalidArgument: (:) [Add-Computer], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Mic
how to resolve this error
run : Add-Computer -DomainName lab.com
then restart the pc manually
then restart the pc manually
ASKER
Add-Computer : This command cannot be executed on target computer('SRV1') due to following error: The specified domain
either does not exist or could not be contacted.
At line:1 char:13
+ Add-Computer <<<< -DomainName Dascase.com
+ CategoryInfo : InvalidOperation: (SRV1:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException, Microsoft. PowerShell .Commands. AddCompute rCommand
Now its Showing the above error
either does not exist or could not be contacted.
At line:1 char:13
+ Add-Computer <<<< -DomainName Dascase.com
+ CategoryInfo : InvalidOperation: (SRV1:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,
Now its Showing the above error
try Add-Computer -DomainName Dascase
ASKER
Add-Computer : This command cannot be executed on target computer('SRV1') due to following error: Unknown error (0xa8b
.
At line:1 char:13
+ Add-Computer <<<< -DomainName Dascase
+ CategoryInfo : InvalidOperation: (SRV1:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException, Microsoft. PowerShell .Commands. AddCompute rCommand
now its showing this error
.
At line:1 char:13
+ Add-Computer <<<< -DomainName Dascase
+ CategoryInfo : InvalidOperation: (SRV1:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,
now its showing this error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Add-Computer : This command cannot be executed on target computer('SRV1') due to following error: The specified domain
either does not exist or could not be contacted.
At line:1 char:13
+ Add-Computer <<<< -DomainName Dascase.com -credential dascase\administrator
+ CategoryInfo : InvalidOperation: (SRV1:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException, Microsoft. PowerShell .Commands. AddCompute rCommand
now its showing this error
either does not exist or could not be contacted.
At line:1 char:13
+ Add-Computer <<<< -DomainName Dascase.com -credential dascase\administrator
+ CategoryInfo : InvalidOperation: (SRV1:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,
now its showing this error
I tried and it works with me, this is the correct cmd, it seems you have a problem contacting your domain.
since you asked about a command and the command is provided to you, this question must be closed, and you can ask in a separate question on how to troubleshoot the problem.
since you asked about a command and the command is provided to you, this question must be closed, and you can ask in a separate question on how to troubleshoot the problem.
ASKER
can u answer me the other question i asked you about manualy joining a computer to a domain
I've requested that this question be deleted for the following reason:
The question has either no comments or not enough useful information to be called an "answer".
The question has either no comments or not enough useful information to be called an "answer".
he asked about a cmd to join a PC to the domain and an example and I replied him with the correct comment after testing it to join a PC to windows 2008 domain, below is my comment:
Add-Computer -DomainName Dascase.com -credential dascase\administrator
when you run this cmd, it will ask you to type the password, try and inform me please
so this is the correct answer to his question, and since he received an error, this is another issue and need troubleshooting, he can ask about it in a separate question.
Add-Computer -DomainName Dascase.com -credential dascase\administrator
when you run this cmd, it will ask you to type the password, try and inform me please
so this is the correct answer to his question, and since he received an error, this is another issue and need troubleshooting, he can ask about it in a separate question.
the correct answer is in the comment which has the ID 40809783, the asker only asks about a cmd to add a computer to a domain and I provided it to him after successfully test it.