how to Enable these Windows Firewall rules using powershell? I have a few servers where I see a blue question mark on the sql server service, as per the picture below.

This is the solution:

Enabling these Windows Firewall rules did the trick for me
Windows Management Instrumentation (WMI-In)
Windows Management
Instrumentation (DCOM-In)

Is there a way I could achieve this via powershell?
You would use the Enable-NetFirewallRule cmdlet:

Enable-NetFirewallRule -Name "WMI-WINMGMT-In-TCP", "WMI-RPCSS-In-TCP"


In order to find the relevant rule names (in order to enable it), you can search existing firewall rules by name by using the Get-NetFirewallRule cmdlet, for example:

Get-NetFirewallRule -Name "*WMI*"


This uses wildcards to final all the rules that contain "WMI" as an example.