V
V
Vladimir2018-06-16 20:29:13
PowerShell
Vladimir, 2018-06-16 20:29:13

How to properly organize a remote connection to a computer using PowerShell Remoting (RPC, WMI, WinRM)?

There are two computers (both under Microsoft accounts). One is connected directly to the router ( Win 10 ), the second via WIFI ( Win 8.1 (Admin-pc) ). Both computers are on the same subnet. The network profile on both computers is set to Private . I'm trying to make it possible to remotely manage a computer based on Win 8.1 using Powershell (that is, execute commands remotely). On Win 8.1 I used the cmdlet Enable-PSRemoting.
Then on the main Win 10 PC ran the command

Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'Имя компьютера с Win 10, Локальный IP компьютера с Win 10'

When trying to run a command on a Win 10 machine
Enter-PSSession Admin-pc -Credential Адрес электронной почты от учетной записи в Win 8.1
The Windows Powershell Credential Request window appears .
5b25406e016e0632249379.png
After entering the appropriate account data, access to the command line of a computer with Win 8.1 opens (it seems like everything works), but the Cyrillic alphabet is displayed incorrectly.
5b2541f07d531632577765.png
When I run the cmdlet Restart-computer Admin-pc, I get the following error:
The Admin-pc could not be restarted with the following error message: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA).

Actually, several questions arose.
  1. How can I connect remotely without entering data from the account or by entering, but not every time, or make it so that the administrator of the computer with Win 10 is a member of the administrators group on the remote computer ( Win 8.1 ) ?
  2. Perhaps you can immediately send data from the account of the remote computer (email address and password) so that the Windows Powershell credential request window does not appear ) ? That is, is it possible to connect somehow by entering a command without additional parameters, as in this image: 5b2548574a430367676063.pngOf course, now such an error pops up, since I did not enter data from the account of the remote computer anywhere.
  3. How to fix the Cyrillic display (perhaps you should install the Powershell 5.1 version , since the computer with Win 8.1 has an earlier one) ?
  4. Is it all organized ( configured ) correctly ? Perhaps there is something else that I did not take into account ?
  5. How to fix RPC server unavailable... error ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2018-06-17
@bossonojka

I answer myself. I managed to find several answers to my own questions.
1. Ilya bow @8889996 solved this issue. Through the search, open Credential Manager , select Windows Credentials , click Add Windows Credentials , enter the computer name on the network (or its local IP ), username and password from the computer account (to which we are going to connect remotely). Now, instead of such a command

Enter-PSSession Admin-pc -Credential Адрес электронной почты от учетной записи в Win 8.1
and additional password entry, you can use Enter-PSSession Admin-pcand without entering an additional password. By the way, so that the Windows Powershell Credential Request
window does not appear in Powershell, you need to go to the following path in the registry
and create a string parameter there with the name ConsolePrompting and the value True .
5. In the firewall , select Allow communication with an application or component in the WIndows firewall and check the checkbox next to Windows Management Instrumentation . The error RPC server is unavailable... has disappeared, the commands pass successfully.

I
Ilya bow, 2018-06-17
@8889996

1. And try adding the login password to the Windows Credential Manager. Maybe it will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question