Powershell Open Port Profile, All (private public domain)

Question:

I’ve a powershell script that opens port 5555, but it defaults to profile = private, when I want it to be all (private, public, domain). How can I modify the script to achieve this?

Answer:

You can use FwPolicy2 and FWRule to create a rule for all profiles:

Here are the used constants:

(Source: http://www.ohmancorp.com/files/RefWin-AdvFirewall-JCopyFWRules.txt)

Source:

Powershell Open Port Profile, All (private public domain) by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply