Using Group Policy to enable WMI (Windows Management Instrumentation) remote requests through the Windows Firewall
It is always a good idea to enable the Windows firewall under the domain profile. Enabling the firewall can prevent needed functionality as well. For example, in some scenarios it may be required to be able to interact with client workstations or servers via WMI (which would be a type of unsolicited DCOM request on port 135). Windows firewall will block this functionality unless you explicitly allow it. To allow WMI remote requests through the windows firewall using Group Policy, the “Allow Remote Administration Exception” policy needs to be enabled in the group policy object being applied to the workstations and / or servers requiring this access in the environment. In order to set this, open up Group Policy Manager, and browse to the following location: Computer Configuration\Administrative Template\Network\Network Connections\Windows Firewall\Domain Profile(if setting this for the domain profile). The same policy can be found in the “Standard Profile” as well.
Once you enable “Allow Remote Administration Exception” (and the computer objects refresh their policies usually 4 hours), WMI traffic should be allowed.
If you are impatient like me, sometimes it is best to just issue a command from the commmand line and be done. The following are examples of commands that can be used to enable the same functionality as above.
Allow WMI through the Windows Firewall from the command line
If a connect attempt using wbemtest.exe fails – follow these steps to allow the requests through the firewall.
From the local machine command line, if the platform is Windows XP / Server 2003 (Below are three commands each providing different options)
c:\> netsh firewall set service remoteadmin enable
c:\> netsh firewall set service remoteadmin enable subnet
c:\> netsh firewall set service remoteadmin enable custom 192.168.1.1,LocalSubnet
Windows7 / Server 2008 (Two commands below provide 2 ways to set the firewall to allow WMI)
c:\> netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes
You should see something like the following if successful.
Updated X rule(s) (where X is the number of rules updated)
c:\> netsh advfirewall firewall set rule group="remote administration" new enable=yes
Again, you will see something like the following if successful.
Updated X rule(s).
This should be all that is required to allow WMI remote requests through the Windows Firewall. The name of the Group Policy Object setting prevented me from getting this to work for quite a while.