Enable WinRM service remote connection

WinRM (Windows Remote Management) is a Microsoft protocol that allows for remote management of Windows-based computers. It allows users to execute commands remotely. We will use this service to remotely connect from Management Client to our Domain Controller

In the DC1 terminal, we will run this command line

Enable-PSRemoting
ifconfig

This enables the WinRM service and also retrieves the DC1 IP address (192.168.126.139).

Now we go back to the Management client machine, we will try to establish a connection to DC1. Run Powershell as Administrator and we will use these command lines below


Start-Service WinRM
Get-Item WSMan:\localhost\Client\TrustedHosts
Set-Item WSMan:\localhost\Client\TrustedHosts -Value '192.168.126.139'

New-PSSession -ComputerName 192.168.126.139 -Credential (Get-Credential)

Enter the credential of DC1 (Administrator:<password>)

Enter-PSSession 2

Now, we have successfully established a remote connection from the management client machine to DC1.

Last updated