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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Make Network Traffic Fast and Furious with SD-WAN

Software-defined WAN (SD-WAN) is a technology that determines the most effective way to route traffic to and from datacenter sites. Register for the webinar today to learn how your business can benefit from SD-WAN!

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.