How to configure servers for remote access (WinRM and PSRemoting)

Note: WinRM is enabled by default on all Windows Server operating systems since Windows Server 2012 and above, but disabled on all client operating systems like Windows 10 etc.

On the Windows server, you literally do not have anything to do to have this service enabled.

To configure your servers for remote access, follow the steps below.
Enable PSReomoting

Launch your server
Fire up a PowerShell terminal
Type "Enable-PSRemoting" 

This will enable the server for PSRemoting and allow the server to be accessed via remote access.

Add the servers to TrustedHosts list
Add the host to the TrustedHosts list with the command, for more information, see https://techdirectarchive.com/2020/03/25/how-to-add-servers-to-trustedhosts-list-via-powershell/

RestartWinRM service with the command below via PowerShell

Restart-Service winrm

To test the WinRM Configuration, run the command below.

winrm quickconfig

Method 1: To test remote access using PowerShell Remoting, use the command below, replace “ansible” with your remote computer

Enter-PSSession -ComputerName Ansibleserver

Method 2: To permit a remote connection via PowerShell remoting, use the command below

Enter-PSSession -ComputerName TechDArchive -Credential $Credentials

As shown below, the authentication is successful and I am able to remotely manage the machine via PowerShell Remoting.

For other related links


Leave a Reply

%d bloggers like this: