Enabling remote Powershell on workgroup computers

Using remote Powershell on workgroup computers is disabled by default. This is how to enable it at the host and the client.

Host

At the host that we want to reach with Powershell, we need to enable the Win-RM service. This is easily done like this:

  • Run Powershell as administrator

  • Run the command “Enable-PSRemoting” and answer Yes to all the questions.

  • To add a bit of security, restrict the firewall rule to only allow traffic from the IP address of the Client that we want to do the remote Powershell from. This can be done with this command:

    Set-NetFirewallRule -DisplayName “Windows Remote Management (HTTP-In)” -RemoteAddress “192.168.0.223”

    The IP address in the end of the command is the address of the Client. This is not needed to get things working, but just a safety precaution.

Client

At the client, we need to tell Powershell that we trust the Host that we want connection to. To add the Host to the trusted host-list, do this:

  • Run Powershell as administrator

  • Run the command:

    “Set-Item WSMan:\localhost\Client\TrustedHosts -Value “192.168.0.10” “

    The IP address in the end of the command is the address of the Host.

    Answer Yes to the question/s.

If you get this error: ​

Run the command ”Start-Service winrm” and then the Set-Item… command again.

In case you want to trust connections to all hosts, just replace the IP address with a wildcard *, like this:

“Set-Item WSMan:\localhost\Client\TrustedHosts -Value “*” “

Now we are ready to connect to the Host through Powershell!

This entry was posted in Uncategorized and tagged , , , , , , , , . Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s