How to enable WinRM via Group Policy

In order to remotely manage computers via Powershell, you must enable Windows Remote Management.

Open Group Policy management.

Create a new GPO.

image.png

image.png


Right-click your newly created GPO and click Edit...

image.png

First we need to allow it on each computer's firewall. Open Computer Configuration --> Policies --> Windows Settings --> Security Settings --> Windows Firewall with Advanced Security --> Windows Firewall with Advanced Security --> Inbound Rules

image.png

Create a New Rule

image.png

Microsoft was nice enough to include it as a predefined Rule

image.png

I unchecked Public as I will be doing connecting locally.

image.png

Click Allow the connection

image.png

The new rule should now be listed. 

image.png

That's it for the firewall. Now you need to go to Computer Configuration --> Policies --> Administrative Templates --> Windows Components --> Windows Remote Management (WinRM) --> WinRM Service --> Allow remote server management through WinRM

image.png

image.png
Syntax:

Type "*" to allow messages from any IP address, or leave the field empty to listen on no IP address. You can specify one or more ranges of IP addresses.

image.png

Link your newly created GPO. This is going to be a computer policy so connect it to an OU of the computers you would like to enable this for.  

image.png

It's also necessary to make sure the WinRM service starts on startup. To do this via GPO, go to Computer Configuration --> Preferences --> Control Panel Settings --> Services

image.png

Right-click and click New --> Service


Choose Automatic (Delayed Start) as the startup type, pick WinRM as the Service name, set Start service as the Service action.

image.png



Once all of your domain computers have updated their policies and had a chance to start that system service, you should be able to remotely manage them using Powershell.

No comments:

Post a Comment

Popular Tutorials