Add-Computer adds VM to domain then WMI fails

0

I am currently trying to add a Windows Server 2016 Vm to our domain using the following command.

Add-Computer -ComputerName $ServerName -NewName $ServerName -LocalCredential $localCreds -Credential $adcreds -DomainName mydomain.net -OUPath $ou -Force

The command creates the AD computer object and renames the server pending its reboot.

However, the cmdlet runs for about 15 minutes then gives us the following error:

Add-Computer : Cannot establish the WMI connection to the computer 'SERVER' with the following error message: The remote procedure call failed. (Exception from HRESULT: 0x800706BE).

We are not experiencing this issue at all with our Windows Server 2012 R2 Build.

powershell
active-directory
asked on Stack Overflow Jul 3, 2017 by Johnrad

1 Answer

0

Looks like failed authentication. You can try to connect to the remote computer by the following code example:

Net use \$servername\IPC$ /User:Administrator $LocalCreds.GetNetworkcredential().password

After that, try your command again.

answered on Stack Overflow Jul 4, 2017 by restless1987

User contributions licensed under CC BY-SA 3.0