Windows 2008 Firewall


In our environment we have enabled the windows firewall in windows 2008 servers.  After that we are not able run any VB script against those servers. What are port required for VB script using WMI and which port psexec use?
Who is Participating?
445 and 139

You can use netsh command for creating port exceptions:

Netsh firewall add portopening
                   [ protocol = ] TCP|UDP|ALL
                   [ port = ] 1-65535
                   [ name = ] name
                   [ [ mode = ] ENABLE|DISABLE
                   [ scope = ] ALL|SUBNET|CUSTOM
                   [ addresses = ] addresses
                   [ profile = ] CURRENT|DOMAIN|STANDARD|ALL
                   [ interface = ] name ]

netsh firewall add portopening TCP 80 MyWebPort
netsh firewall add portopening UDP 500 IKE ENABLE ALL
netsh firewall add portopening ALL 53 DNS ENABLE CUSTOM,,,LocalSubnet
netsh firewall add portopening protocol = TCP port = 80 name =MyWebPort
netsh  firewall add  portopening protocol = UDP port = 500 name = IKE mode = ENABLE scope = ALL
netsh  firewall add portopening protocol = ALL port = 53 name =DNS mode = ENABLE scope = CUSTOM addresses =,,,LocalSubnet
For psexec you need ports 135 and 445.
For WMI please look here:
valuelabs97Author Commented:

Thank you. Will there be way to check what and all the ports enabled in a server
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

valuelabs97Author Commented:
Hi davorin,

Even I included the WMI in the exception list, I am not able to connect the server remotely.
Have you added RPC port?
valuelabs97Author Commented:
Hi rishabv1,

I added RPC port too
Sorry for long delay.

Example of command user to show all rules (ports) open in inbound direction:
netsh advfirewall firewall show rule name=all dir=in

At the end you can add profile=domain to list only open ports at domain firewall profile. Other options are public and private.

For checking FW state for WMI should work:
netsh advfirewall firewall show rule name="WMI"

Are you opening this ports in network profile the server is using?
valuelabs97Author Commented:
Hi davorin
Sorry for long delay

I have opened the ports. Still we are facing the same issue.

valuelabs97Author Commented:
I tried the solutions but we are no longer working on this now. Hence abandoned this Thanks for the everyone's efforts on this
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.