PowerShell 3 and later
If you want to access a computer remotely via PowerShell, then on the destination side (on the computer you want to visit), run this line of code with Administrator privileges:
PS> Enable-PSRemoting -SkipNetworkProfileCheck -Force
Once you did, you can now visit this computer from another box – provided you have local Administrator privileges on the target machine, you do specify the computer name and not its IP address, and both computers are joined in the same domain.
To connect interactively, use this line:
PS> Enter-PSSession -ComputerName targetComputerName
To run code remotely, try this:
PS> Invoke-Command -ScriptBlock { Get-Service } -ComputerName targetComputerName