No configuration is required to enable a computer to send remote commands. However, to receive remote commands, the computer must be configured for remoting. The configuration includes starting the Windows Remote Management (WinRM) service, setting the startup type for the WinRM service to Automatic, creating listeners for HTTP and HTTPS connections, and creating default session configurations.

When you try to run a command on a computer that is not enabled for remoting, Windows PowerShell displays one of the following error messages, depending on the circumstances.

  Copy Code
ERROR:  ACCESS IS DENIED

- or -

  Copy Code
ERROR:  The connection to the remote host was refused. 
Verify that the WS-Management service is running on the remote
host and configured to listen for requests on the correct port
and HTTP URL.

This topic explains how to enable remoting on a remote computer.

To configure a computer to receive remote commands

  • Use the Enable-PSRemoting cmdlet. The following command enables all required remote settings, enables the session configurations, and restarts the WinRM service to make the changes effective. At the Windows PowerShell prompt, type:

      Copy Code
    enable-psremoting
    

    To suppress all user prompts while the computer is being configured for remoting, type:

      Copy Code
    enable-psremoting -force
    

See Also