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
https://blogs.technet.microsoft.com/christwe/2012/06/20/what-port-does-powershell-remoting-use/
https://docs.microsoft.com/en-us/previous-versions//dd347668(v=technet.10)?redirectedfrom=MSDN
https://4sysops.com/archives/enable-powershell-remoting-on-a-standalone-workgroup-computer/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s