Assuming that you have machine A and B in a Windows domain. From machine A you want to make remote connection to machine B. 

On machine B, the machine to which you want to make remote connections, make the following changes:

1. Run Windows PowerShell as administrator

2. In the PowerShell console, run the cmdlet "Enable-PSRemoting -Force" 


This command starts the WinRM service, sets it to start automatically with your system, and creates a firewall rule that allows incoming connections. The -Force part of the cmdlet tells PowerShell to perform these actions without prompting you for each step.

That’s all the setup you have to do.