I am trying to run this from a .cmd with run as administrator
powershell -Command "&{ Start-Process powershell Add-Computer -Domain "domain.domain" -Credential login -Verb RunAs -Wait -Confirm}"
The window to input password does pop up, but after I input the password I am greeted with the following error on my batch script.
Start-Process : O conjunto de parâmetros não pode ser resolvido usando os parâmetros nomeados especificados.
No linha:1 caractere:4
+ &{ Start-Process powershell Add-Computer -Domain domain.domain -Cr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.StartProcessCommand
I want to join a domain via scripting, I tried to use netdom, but it's exclusive to servers. I am dealing with client notebooks with Windows 10, very far from the server, and I don't have any admin access to the server domai. I am just formatting a huge amount of computers to a specified state, and that includes joining then on a domain. I don't care how I join the domain as long as I join the domain automatically, (if impossible asking for password is acceptable), from a batch or powershell script, and without instaling anything.