How to Enable PowerShell Remoting via the Enable-PSRemoting Cmdlet

The Foundation of Remote Administration

PowerShell is the standard automation engine in modern Windows environments, but its true power lies in its ability to execute code across the network. If you need to restart a service on 50 servers simultaneously, you do not use Remote Desktop to log into each one individually. Instead, you use the Invoke-Command cmdlet to push the instruction to all 50 servers in parallel.

However, this remote execution relies entirely on a background service called Windows Remote Management (WinRM). For security reasons, Microsoft disables WinRM on standard Windows 10 and 11 workstations by default, though it is usually enabled on Windows Server editions. Before you can remotely manage a machine, you must explicitly enable PowerShell Remoting.

Using the Enable-PSRemoting Cmdlet

The easiest way to configure a single machine to accept remote commands is to run the built-in configuration cmdlet directly on that target machine.

You must open PowerShell with elevated Administrator privileges, or the command will fail.

Enable-PSRemoting -Force

What does this single command actually do?

By appending the -Force parameter, you bypass all the confirmation prompts, allowing the cmdlet to perform four critical actions instantly:

  1. Starts the WinRM service: It changes the startup type of the Windows Remote Management background daemon from Disabled to Automatic, and then immediately starts it.
  2. Creates the HTTP Listener: It instructs the WinRM service to bind to TCP port 5985 and begin listening for incoming connections from the local subnet.
  3. Configures Firewall Exceptions: It automatically injects an exception rule into the Windows Defender Firewall, allowing inbound traffic on port 5985.
  4. Enables the Session Configuration: It registers the default Microsoft.PowerShell session endpoint, which handles the actual execution of the incoming scripts.

Testing the Connection

Once you have run the command on the target computer (e.g., FILE-SRV-01), you should return to your IT workstation and verify that the connection was established successfully.

From your workstation, run the Test-WSMan cmdlet, which simply pings the WinRM service on the remote machine to verify it is alive.

Test-WSMan -ComputerName "FILE-SRV-01"

If the service is running and the firewall is open, it will return a brief table showing the protocol version and the OS version of the remote server. You are now free to use Enter-PSSession or Invoke-Command to manage that server remotely.

Troubleshooting the Public Network Profile

If you run Enable-PSRemoting and receive a stark red error stating that a firewall exception could not be created, it is almost certainly because the computer’s network adapter is currently classified as a “Public” network rather than a “Domain” or “Private” network.

Windows strictly forbids opening administrative management ports on Public networks (like a coffee shop Wi-Fi). You must either change the network profile to Private using the Set-NetConnectionProfile cmdlet, or force PowerShell to skip the network check by appending the -SkipNetworkProfileCheck parameter (which is highly discouraged for security reasons).

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.