I have a bunch of machines that I need to enable Remote Scheduled Tasks Management (RPC), Remote Scheduled Tasks Management (RPC-EPMAP), and Windows Management Instrumentation (WMI-in) on for GPO Updates.
I would like to run a PowerShell script so I do not have to do this manually. However, I am new to powershell.
Is there a way I can get the powershell command when I add the rules manually at a machine?
EDIT:
This is one way I found to do it:
netsh advfirewall firewall set rule group="Remote Administration" new enable=yes
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes
netsh advfirewall firewall set rule group="Remote Service Management" new enable=yes
netsh advfirewall firewall set rule group="Performance Logs and Alerts" new enable=yes
Netsh advfirewall firewall set rule group="Remote Event Log Management" new enable=yes
Netsh advfirewall firewall set rule group="Remote Scheduled Tasks Management" new enable=yes
netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes
netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes
netsh advfirewall firewall set rule group="Windows Firewall Remote Management" new enable =yes
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable =yes
However, I have to execute it on every machine.
For some reason, this one does not work:
Enable-NetFirewallRule -DisplayGroup “Windows Remote Management”
Working on Windows Server 2012 R2 Core, this worked for me:
Here is how to check if it was succesful
And find the value in "Enabled", it should be set to TRUE.
More info and arguments can be found here:
Set-NetFirewallRule Technet
According to this article on Technet, only on Server 2012 or Windows 8: http://technet.microsoft.com/en-us/library/hh831755.aspx
Windows 7 and Server 2008 require Netsh, even with Powershell 4.0.